SPB Git
774 B · 21 lines tsx
1'use client';23import { IncidentRow } from '@/components/incidents/IncidentRow';4import { Empty } from '@/components/ui/primitives';5import { useLive } from '@/lib/live';6import type { Incident } from '@/lib/types';78export function IncidentsList({ initial, compact = false, limit }: { initial: Incident[] | null; compact?: boolean; limit?: number }) {9  const live = useLive((s) => s.incidents);10  let list = live ?? initial ?? [];11  if (limit) list = list.slice(0, limit);12  if (!list.length) return <Empty>No active incident. Anomalies below the detection threshold are not reported.</Empty>;13  return (14    <ul className="divide-y divide-line">15      {list.map((inc) => (16        <IncidentRow key={inc.event_id} inc={inc} compact={compact} />17      ))}18    </ul>19  );20}21
Files · 2ad054aee22a11bbac5c2a273c5d186a8a903b50
Menu

Theme