import { create } from 'zustand'
import api from '../api/api'

const useReport = create((set, get) => ({
    report: null,
    isLoading: true,

    getReport: async () => {
        try {
            const res = await api.get('/report')
            if(res.status == 200) {
                set({ report: res.data, isLoading: false })
                return res.data
            }
        } catch (error) {
            console.log(error)
        }finally{
            set({ isLoading: false })
        }
    }
}))


export default useReport