import { withList } from '../utils/listManager'

export function logsManager() {
    return {
        ...withList({ url: '/admin/logs' }),

        async init() { await this.fetch(1) },

        actionColor(action) {
            if (action.includes('create')) return 'bg-green-100 text-green-700'
            if (action.includes('update')) return 'bg-blue-100 text-blue-700'
            if (action.includes('delete')) return 'bg-red-100 text-red-700'
            return 'bg-gray-100 text-gray-700'
        },
    }
}
