/** * Stats dashboard showing job counts by status. */ import React from "react"; import { CheckCircle2, Clock, Loader2, Search, Sparkles, XCircle, } from "lucide-react"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import type { JobStatus } from "../../shared/types"; interface StatsProps { stats: Record; } const statConfig: Array<{ key: JobStatus; label: string; Icon: React.ComponentType<{ className?: string }>; }> = [ { key: "discovered", label: "Discovered", Icon: Search }, { key: "processing", label: "Processing", Icon: Loader2 }, { key: "ready", label: "Ready", Icon: Sparkles }, { key: "applied", label: "Applied", Icon: CheckCircle2 }, { key: "rejected", label: "Rejected", Icon: XCircle }, { key: "expired", label: "Expired", Icon: Clock }, ]; export const Stats: React.FC = ({ stats }) => { const total = Object.values(stats).reduce((a, b) => a + b, 0); return ( Overview
{total} total jobs
{statConfig.map(({ key, label, Icon }) => (
{stats[key] || 0}
{label}
))}
); };