diff --git a/web/src/components/TargetDetail.tsx b/web/src/components/TargetDetail.tsx new file mode 100644 index 0000000..6a1a637 --- /dev/null +++ b/web/src/components/TargetDetail.tsx @@ -0,0 +1,207 @@ +import { motion } from "motion/react"; +import type { Bucket, Incident, LiveTarget } from "../lib/types"; +import { StatusRing } from "./StatusRing"; +import { Sparkline } from "./Sparkline"; +import { RadialDay } from "./RadialDay"; +import { IncidentList } from "./IncidentList"; +import { + fmtDate, + fmtInterval, + fmtLatency, + fmtNumber, + fmtUptime, + pctSign, +} from "../lib/format"; +import { springs, STATE_COLOR, useUI } from "../lib/ui"; + +interface TargetDetailProps { + target: LiveTarget; + buckets: Bucket[]; + incidents: Incident[]; + onClose: () => void; +} + +function Stat({ label, value, accent }: { label: string; value: string; accent?: string }) { + return ( +
+ {target.type === "http" ? ( + + {target.endpoint} ↗ + + ) : ( + target.endpoint + )} +
++ ● {t.state[target.state]} + {target.fails > 0 && target.state !== "down" && ( + · {fmtNumber(lang, target.fails)} {t.failed} + )} +
+ +