"use client"; import { useState } from "react"; import { useCalls } from "@/lib/useCalls"; import { useSystems } from "@/lib/useSystems"; import { CallRow } from "@/components/CallRow"; export default function CallsPage() { const [limitCount, setLimitCount] = useState(100); const { calls, loading } = useCalls(limitCount); const { systems } = useSystems(); const systemMap = Object.fromEntries(systems.map((s) => [s.system_id, s])); const active = calls.filter((c) => c.status === "active"); const ended = calls.filter((c) => c.status === "ended"); return (

Calls

{calls.length} loaded
{active.length > 0 && (

Live ({active.length})

{active.map((c) => ( ))}
Time Talkgroup System Node Duration Audio
)}

History

{loading ? (

Loading…

) : ended.length === 0 ? (

No calls recorded yet.

) : ( <>
{ended.map((c) => ( ))}
Time Talkgroup System Node Duration Audio
{ended.length >= limitCount && ( )} )}
); }