import axios from 'axios'; const API_BASE_URL = '/api'; interface ChartDataResponse { message: string; data: T; } interface UserActivityData { date: string; count: number; } interface FileUploadsData { month: string; count: number; } interface FileTypesData { type: string; value: number; } interface DashboardOverviewData { userCount: number; fileCount: number; articleCount: number; todayLoginCount: number; } export const ChartAPI = { getUserActivity: async (): Promise> => { try { const response = await axios.get(`${API_BASE_URL}/charts/user-activity`); return response.data; } catch (error) { throw error; } }, getFileUploads: async (): Promise> => { try { const response = await axios.get(`${API_BASE_URL}/charts/file-uploads`); return response.data; } catch (error) { throw error; } }, getFileTypes: async (): Promise> => { try { const response = await axios.get(`${API_BASE_URL}/charts/file-types`); return response.data; } catch (error) { throw error; } }, getDashboardOverview: async (): Promise> => { try { const response = await axios.get(`${API_BASE_URL}/charts/dashboard-overview`); return response.data; } catch (error) { throw error; } } };