'use client' import { useQuery } from '@tanstack/react-query' import { Card, CardContent } from '@/components/ui/card' import { Badge } from '@/components/ui/badge' import { AlertTriangle, RefreshCw } from 'lucide-react' import { api } from '@/lib/api' import { ErrorEvent } from '@/lib/types' import { formatRelative, formatDate } from '@/lib/utils' import { Button } from '@/components/ui/button' export default function AdminErrorsPage() { const q = useQuery({ queryKey: ['admin', 'errors'], queryFn: async () => (await api.get('/admin/errors', { params: { limit: 200 } })).data, refetchInterval: 10_000, }) return (

Server errors

Last 200 unhandled exceptions captured by the API.

{(q.data || []).map((e) => ( ))}
When Status Method Path Message
{formatRelative(e.createdAt)} = 500 ? 'destructive' : 'warning'}>{e.status || 'ERR'} {e.method} {e.path} {e.message}
{(q.data || []).length === 0 && (
No errors recorded.
)}
) }