/** 案卡组件(TASK-009) * 公共组件:展示单张案卡,支持点击和归档 */ import { Scale, TrendingUp, Heart, ShieldCheck, Archive } from 'lucide-react' import { cn, MATTER_STATUS_LABELS, MATTER_STATUS_COLORS, SCENE_LABELS, formatRelative } from '@/lib/utils' import type { Matter, Scene } from '@/types' const SCENE_ICONS: Record = { legal: Scale, decision: TrendingUp, life: Heart, emotion: ShieldCheck, } interface MatterCardProps { matter: Matter onClick?: () => void onArchive?: () => void } export function MatterCard({ matter, onClick, onArchive }: MatterCardProps) { const Icon = SCENE_ICONS[matter.scene] || Scale return (
{matter.title}
{SCENE_LABELS[matter.scene]} · {formatRelative(matter.updated_at)}
{MATTER_STATUS_LABELS[matter.status]}
{onArchive && matter.status === 'closed' && ( )}
) }