import { useState, useEffect } from 'react' import api from '@/services/api' import type { DashboardStats, Task } from '@/types' export default function DashboardPage() { const [stats, setStats] = useState(null) useEffect(() => { api.get('/dashboard/stats').then(({ data }) => setStats(data)) }, []) if (!stats) return
Loading...
const statusColors: Record = { open: '#3b82f6', in_progress: '#f59e0b', resolved: '#10b981', closed: '#6b7280', blocked: '#ef4444', } const priorityColors: Record = { low: '#6b7280', medium: '#3b82f6', high: '#f59e0b', critical: '#ef4444', } return (

📊 Dashboard

{stats.total_tasks} Total Tasks
{Object.entries(stats.by_status || {}).map(([k, v]) => (
{v} {k}
))}

By Priority

{Object.entries(stats.by_priority || {}).map(([k, v]) => (
{k}
{v}
))}

Recent Tasks

{(stats.recent_tasks || []).map((i) => ( ))}
CodeTitleStatusPriorityTypeSubtype
{i.task_code || `#${i.id}`} {i.title} {i.status} {i.priority} {i.task_type}{i.task_subtype || "-"}
) }