import { fmtDate } from '../../lib/format.js' import { typeInfo } from '../../lib/constants.js' import EvidenceHash from './EvidenceHash.jsx' const HEADERS = { auto_confirmed: 'AUTOMATED e-CHALLAN (DRAFT)', vlm_confirmed: 'AUTOMATED e-CHALLAN (DRAFT)', human_review: 'e-CHALLAN — PENDING REVIEW', abstain: 'e-CHALLAN — NOT ISSUED (ABSTAINED)', } export default function EChallanCard({ v }) { const t = typeInfo(v.type) const dispo = (v.review_status && v.review_status !== '' ? v.review_status : v.route) || v.route return (
{HEADERS[v.route] || 'e-CHALLAN'}
Violation {t.label} ({v.type}) Plate {v.plate && v.plate.text ? ( {v.plate.text} ) : ( not captured )} Law {v.legal ? `${v.legal.act} · §${v.legal.section}` : '—'} Fine {v.legal ? v.legal.fine : '—'} Disposition {dispo} Date {fmtDate(v.created_at)} UTC Evidence Image ID {v.image_id}
) }