import { Card, Group, Text, Badge, ActionIcon, Menu } from '@mantine/core'; import { IconDots, IconTrash, IconEdit, IconPlayerPlay } from '@tabler/icons-react'; const fmt = (v: number) => v.toLocaleString('en-US', { style: 'currency', currency: 'USD', maximumFractionDigits: 0 }); const statusColors: Record = { draft: 'gray', active: 'blue', approved: 'green', archived: 'red', }; interface Props { scenario: any; onClick: () => void; onEdit: () => void; onDelete: () => void; } export function ScenarioCard({ scenario, onClick, onEdit, onDelete }: Props) { return ( {scenario.name} {scenario.status} e.stopPropagation()}> } onClick={(e: any) => { e.stopPropagation(); onEdit(); }}> Edit } color="red" onClick={(e: any) => { e.stopPropagation(); onDelete(); }}> Archive {scenario.description && ( {scenario.description} )} {scenario.scenario_type === 'investment' && ( <>
Investments {scenario.investment_count || 0}
Total Principal {fmt(parseFloat(scenario.total_principal) || 0)}
)} {scenario.scenario_type === 'assessment' && (
Changes {scenario.assessment_count || 0}
)}
Updated {new Date(scenario.updated_at).toLocaleDateString()}
); }