import apiClient from '../client'
import type {
  DashboardStatsResponse,
  DashboardActiveModelResponse,
  RecentActivityResponse,
} from '../types'

export const dashboardApi = {
  getStats: async (): Promise<DashboardStatsResponse> => {
    const response = await apiClient.get('/api/v1/admin/dashboard/stats')
    return response.data
  },

  getActiveModel: async (): Promise<DashboardActiveModelResponse> => {
    const response = await apiClient.get('/api/v1/admin/dashboard/active-model')
    return response.data
  },

  getRecentActivity: async (limit: number = 10): Promise<RecentActivityResponse> => {
    const response = await apiClient.get('/api/v1/admin/dashboard/activity', {
      params: { limit },
    })
    return response.data
  },
}
