SPB Git forge
15commits 1branches 0releases
29.7 MBsize
maindefault branch
10 days agolast push
TypeScript 36.3% Python 31.8% Go 18% JavaScript 9.8% Shell 1.9% SQL 1.4% CSS 0.5%
774 B · 21 lines tsx
Raw Blame History
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