diff --git a/web/src/components/IncidentList.tsx b/web/src/components/IncidentList.tsx new file mode 100644 index 0000000..ab4cd1e --- /dev/null +++ b/web/src/components/IncidentList.tsx @@ -0,0 +1,92 @@ +import { AnimatePresence, motion } from "motion/react"; +import type { Incident, LiveTarget } from "../lib/types"; +import { fmtDate, fmtDuration } from "../lib/format"; +import { springs, useUI } from "../lib/ui"; + +interface IncidentListProps { + incidents: Incident[]; + targets: LiveTarget[]; + compact?: boolean; + hideTarget?: boolean; + /** When set, clicking a row opens that target's detail. */ + onSelect?: (id: string) => void; +} + +export function IncidentList({ incidents, targets, compact, hideTarget, onSelect }: IncidentListProps) { + const { t, lang, reduced } = useUI(); + const nameOf = (id: string) => targets.find((x) => x.id === id)?.name ?? id; + + return ( +
{t.noIncidents}
+ ) : ( +