'use client'; import { Card } from '@/components/ui/card'; import { FileText, Clipboard, CheckCircle, Clock } from 'lucide-react'; import { DashboardStats } from '@/types/dashboard'; export interface StatsCardsProps { stats: DashboardStats | undefined; isLoading: boolean; } export function StatsCards({ stats, isLoading }: StatsCardsProps) { if (isLoading || !stats) { return (
{[...Array(4)].map((_, i) => ( ))}
); } const cards = [ { title: 'Total Correspondences', value: stats.totalDocuments, icon: FileText, color: 'text-blue-600', bgColor: 'bg-blue-50', }, { title: 'Active RFAs', value: stats.totalRfas, icon: Clipboard, color: 'text-purple-600', bgColor: 'bg-purple-50', }, { title: 'Approved Documents', value: stats.approved, icon: CheckCircle, color: 'text-green-600', bgColor: 'bg-green-50', }, { title: 'Pending Approvals', value: stats.pendingApprovals, icon: Clock, color: 'text-orange-600', bgColor: 'bg-orange-50', }, ]; return (
{cards.map((card) => { const Icon = card.icon; return (

{card.title}

{card.value}

); })}
); }