import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/Card.tsx'; import { Stack } from '@/components/ui/layout'; import Spinner from '@/components/ui/Spinner.tsx'; import { formatCurrency } from '@/lib/fin'; import SimpleBarChart from './SimpleBarChart'; type Props = { isLoading: boolean; matchSuccessRate: number; avgMatchTime: number; totalMatchValue: number; topResourceTypes: Array<{ type: string; count: number }>; t: (key: string) => string; }; const MatchingPerformanceSection = ({ isLoading, matchSuccessRate, avgMatchTime, totalMatchValue, topResourceTypes, t, }: Props) => { const formatPercentage = (value: number) => `${(value * 100).toFixed(1)}%`; return ( {t('analyticsDashboard.matchingPerformance')} {isLoading ? (
) : (
{formatPercentage(matchSuccessRate)}

{t('analyticsDashboard.successRate')}

{avgMatchTime.toFixed(1)}

{t('analyticsDashboard.avgDays')}

{t('analyticsDashboard.totalMatchValue')}
{formatCurrency(totalMatchValue)}
{topResourceTypes.length > 0 && ( ({ label: item.type, value: item.count }))} title={t('analyticsDashboard.topResourceTypes')} /> )}
)}
); }; export default MatchingPerformanceSection;