From 5d8c88c15129e3a9dcfac9981374db223d67c10a Mon Sep 17 00:00:00 2001 From: arsam Date: Fri, 18 Sep 2026 23:20:02 +0330 Subject: [PATCH] Import source: web/src/components/IncidentList Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality. --- web/src/components/IncidentList.tsx | 92 +++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 web/src/components/IncidentList.tsx 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 ( +
+ {!compact ? null : ( +
+ {t.incidents} + +
+ )} + + {incidents.length === 0 ? ( +

{t.noIncidents}

+ ) : ( + + )} +
+ ); +}