import { pct } from '../../lib/format.js' import { routeInfo, typeInfo } from '../../lib/constants.js' import Badge from '../common/Badge.jsx' import PlateChip from '../common/PlateChip.jsx' // Compact, interpretable card. Click opens the full detail view. export default function ViolationCard({ v, onOpen }) { const t = typeInfo(v.type) const r = routeInfo(v.route) const conf = pct(v.scores?.fused) const law = v.legal ? `${v.legal.act}, §${v.legal.section} · fine ${v.legal.fine}` : '' return (
onOpen?.(v)}>
{t.icon}
{t.label} · Tier {v.tier}
{v.reason}
Plate: {law ? ` · ${law}` : ''}
{r.label}
{conf}%{r.note ? ` · ${r.note}` : ''}
) }