summaryrefslogtreecommitdiff
path: root/lib/dashboard/dashboard-summary-cards.tsx
blob: 9d1d9ef254df73b6390eb3ba14cd755948aa960e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { CheckCircle, Clock, PlayCircle, Users } from "lucide-react";
import { DashboardData } from "./service";

interface DashboardSummaryCardsProps {
  summary: DashboardData['summary'];
}

export function DashboardSummaryCards({ summary }: DashboardSummaryCardsProps) {
  const cards = [
    {
      title: "전체 업무",
      value: summary.totalTasks,
      icon: Users,
      description: `내 업무 ${summary.myTasks}건`,
      color: "text-blue-600"
    },
    {
      title: "대기중",
      value: summary.teamPending,
      icon: Clock,
      description: `내 대기 ${summary.myPending}건`,
      color: "text-gray-600"
    },
    {
      title: "진행중",
      value: summary.teamInProgress,
      icon: PlayCircle,
      description: `내 진행 ${summary.myInProgress}건`,
      color: "text-blue-600"
    },
    {
      title: "완료",
      value: summary.teamCompleted,
      icon: CheckCircle,
      description: `내 완료 ${summary.myCompleted}건`,
      color: "text-green-600"
    }
  ];

  return (
    <div className="grid gap-4 md:grid-cols-2 lg:grid-cols-4">
      {cards.map((card, index) => {
        const Icon = card.icon;
        return (
          <Card key={index}>
            <CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
              <CardTitle className="text-sm font-medium">
                {card.title}
              </CardTitle>
              <Icon className={`h-4 w-4 ${card.color}`} />
            </CardHeader>
            <CardContent>
              <div className="text-2xl font-bold">{card.value}</div>
              <p className="text-xs text-muted-foreground">
                {card.description}
              </p>
            </CardContent>
          </Card>
        );
      })}
    </div>
  );
}