mirror of
https://github.com/ichsankurnia/hats-app.git
synced 2026-12-05 11:06:29 +00:00
b657f79a2a
Add a dashboard for managing Google Calendar events and tasks, including create, edit, delete, status updates, search, and integration error notices.
86 lines
2.3 KiB
TypeScript
86 lines
2.3 KiB
TypeScript
'use client';
|
|
|
|
import React from 'react';
|
|
import { Calendar, CheckCircle2, Clock, ListTodo } from 'lucide-react';
|
|
import { Card900 } from '@/components/ui/card';
|
|
|
|
interface CalendarStatsOverviewProps {
|
|
totalEvents: number;
|
|
totalTasks: number;
|
|
completedTasks: number;
|
|
pendingTasks: number;
|
|
}
|
|
|
|
export default function CalendarStatsOverview({
|
|
totalEvents,
|
|
totalTasks,
|
|
completedTasks,
|
|
pendingTasks,
|
|
}: CalendarStatsOverviewProps) {
|
|
const cards = [
|
|
{
|
|
title: 'Total Event Kalender',
|
|
value: totalEvents,
|
|
icon: Calendar,
|
|
desc: 'Agenda terjadwal di Google Calendar',
|
|
iconColor: 'text-sky-600 dark:text-sky-400',
|
|
bgColor: 'bg-sky-50 dark:bg-sky-950/40',
|
|
},
|
|
{
|
|
title: 'Total Task',
|
|
value: totalTasks,
|
|
icon: ListTodo,
|
|
desc: 'Item task berlabel [TASK]',
|
|
iconColor: 'text-indigo-600 dark:text-indigo-400',
|
|
bgColor: 'bg-indigo-50 dark:bg-indigo-950/40',
|
|
},
|
|
{
|
|
title: 'Task Selesai',
|
|
value: completedTasks,
|
|
icon: CheckCircle2,
|
|
desc: 'Status: completed / selesai',
|
|
iconColor: 'text-emerald-600 dark:text-emerald-400',
|
|
bgColor: 'bg-emerald-50 dark:bg-emerald-950/40',
|
|
},
|
|
{
|
|
title: 'Task Tertunda',
|
|
value: pendingTasks,
|
|
icon: Clock,
|
|
desc: 'Status: needsAction / menunggu',
|
|
iconColor: 'text-amber-600 dark:text-amber-400',
|
|
bgColor: 'bg-amber-50 dark:bg-amber-950/80',
|
|
},
|
|
];
|
|
|
|
return (
|
|
<div className="grid grid-cols-2 lg:grid-cols-4 gap-3 sm:gap-4">
|
|
{cards.map((card, idx) => {
|
|
const Icon = card.icon;
|
|
return (
|
|
<Card900
|
|
key={idx}
|
|
className="p-4 rounded-xl border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-900 gap-2 shadow-xs"
|
|
>
|
|
<div className="flex items-center justify-between">
|
|
<span className="text-xs font-medium text-zinc-500 dark:text-zinc-400">
|
|
{card.title}
|
|
</span>
|
|
<div className={`p-1.5 rounded-lg ${card.bgColor} ${card.iconColor}`}>
|
|
<Icon className="size-4" />
|
|
</div>
|
|
</div>
|
|
<div className="flex items-baseline gap-2">
|
|
<span className="text-2xl font-bold tracking-tight text-zinc-900 dark:text-zinc-100">
|
|
{card.value}
|
|
</span>
|
|
</div>
|
|
<p className="text-[11px] text-zinc-400 dark:text-zinc-500 truncate">
|
|
{card.desc}
|
|
</p>
|
|
</Card900>
|
|
);
|
|
})}
|
|
</div>
|
|
);
|
|
}
|