import { Loading, ErrorState } from '../../../components/PageState.jsx' import { useAsync } from '../../../lib/useAsync.js' import { dateTime } from '../../../lib/format.js' import { api } from '../../../api/client.js' import { formatDetail } from './Dashboard.jsx' export default function ActivityAdmin() { const { loading, error, data } = useAsync(() => api.admin.activity(100)) const rows = data || [] if (loading) return if (error) return return (
{rows.length === 0 && ( )} {rows.map((a) => ( ))}
Action Detail User IP When
No activity recorded yet.
{a.action} {formatDetail(a)} {a.username || '—'} {a.ip || '—'} {dateTime(a.created_at)}
) }