import { useMemo, useState } from "react" import { DashboardLayout, DashboardHeader, DashboardMain, DashboardContent, Card, CardHeader, CardTitle, CardContent, Progress, Tabs, TabsList, TabsTrigger, TabsContent, DataTable, useDataTable, type DataTableColumnDef } from "@hm-design/ui" import { Heading } from "./Heading" type Summary = { category: string; total: number; completed: number } const columns: DataTableColumnDef[] = [{ accessorKey: "category", header: "업무 분류" }, { accessorKey: "total", header: "전체 건수" }, { accessorKey: "completed", header: "완료 건수" }] export function Dashboard({ statistics = false }: { statistics?: boolean }) { const [period, setPeriod] = useState("week") const data = useMemo(() => ["설계", "시공", "안전"].map((category, i) => ({ category, total: (period === "week" ? 12 : 48) + i, completed: (period === "week" ? 8 : 32) + i })), [period]) const table = useDataTable({ columns, data }) const title = statistics ? "통계 Dashboard" : "업무 Dashboard" return {title}}>이번 주이번 달{["week", "month"].map(p =>
{["진행", "대기", "완료"].map((label, i) => {label}

{(p === "week" ? 12 : 48) + i}건

)}
)}
{statistics && 업무 분류별 집계}
}