"use client" import Link from "next/link" import { BotMessageSquareIcon, CircleDashedIcon, HeadsetIcon, SparklesIcon, WavesIcon, } from "lucide-react" import type { DashboardOverview } from "@/lib/api/dashboard" import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card" import { useI18n } from "@/i18n/provider" type SummaryCardsProps = { summary: DashboardOverview["summary"] } type SummaryCardItem = { key: keyof DashboardOverview["summary"] titleKey: string descriptionKey: string link: string icon: typeof BotMessageSquareIcon format?: (value: number) => string } const cards: SummaryCardItem[] = [ { key: "todayNewConversations", titleKey: "dashboardHome.summaryTodayNewConversations", descriptionKey: "dashboardHome.summaryTodayNewConversationsDescription", link: "/dashboard/conversations", icon: BotMessageSquareIcon, }, { key: "processingConversations", titleKey: "dashboardHome.summaryProcessingConversations", descriptionKey: "dashboardHome.summaryProcessingConversationsDescription", link: "/dashboard/conversations", icon: WavesIcon, }, { key: "pendingDispatchConversations", titleKey: "dashboardHome.summaryPendingDispatchConversations", descriptionKey: "dashboardHome.summaryPendingDispatchConversationsDescription", link: "/dashboard/conversations", icon: CircleDashedIcon, }, { key: "onlineAgents", titleKey: "dashboardHome.summaryOnlineAgents", descriptionKey: "dashboardHome.summaryOnlineAgentsDescription", link: "/dashboard/agents", icon: HeadsetIcon, }, { key: "aiServiceRate", titleKey: "dashboardHome.summaryAiServiceRate", descriptionKey: "dashboardHome.summaryAiServiceRateDescription", link: "/dashboard/ai-agents", icon: SparklesIcon, format: (value: number) => `${value.toFixed(1)}%`, }, ] export function SummaryCards({ summary }: SummaryCardsProps) { const t = useI18n() return (