import type { TargetStatus } from "../../shared/api"; import { StatusDot } from "./StatusDot"; import { SparklineChart } from "./SparklineChart"; interface TargetRowProps { target: TargetStatus; expanded: boolean; onToggle: () => void; } export function TargetRow({ target, expanded, onToggle }: TargetRowProps) { const isUp = target.latestCheck?.success && target.latestCheck?.matched; const sparklineData = target.sparkline.map((duration) => ({ duration })); return ( {target.name} {target.target} {target.type === "http" ? "HTTP" : "Command"} {target.latestCheck?.durationMs !== null && target.latestCheck?.durationMs !== undefined ? `${Math.round(target.latestCheck.durationMs)}ms` : "-"} ); }