import type { RadioChannel } from "@/lib/types"; // node-26#24. A node on a conventional system reports each channel it // decodes and whether the agency encrypts it — the one decode failure nothing // on the node can fix, so it has to be said plainly here. const ALGIDS: Record = { 0x81: "DES-OFB", 0x83: "Triple DES", 0x84: "AES-256", 0x85: "AES-128", 0x9f: "DES-XL", 0xa0: "DVI-XL", 0xa1: "DVP-XL", 0xaa: "ADP (RC4)", }; function mhz(hz: number | null): string { return hz ? `${(hz / 1e6).toFixed(4)} MHz` : ""; } function hex(n: number, width: number): string { return n.toString(16).toUpperCase().padStart(width, "0"); } export function RadioChannels({ channels }: { channels?: RadioChannel[] | null }) { if (!channels || channels.length === 0) return null; const encrypted = channels.filter((c) => c.encrypted); // "Reassign the node" only when nothing in the clear has ever been heard on // any channel — `encrypted` alone means the most recent call was. const all = encrypted.length === channels.length && channels.every((c) => c.clear_calls === 0); const subject = all ? channels.length === 1 ? "This channel is" : "Every channel is" : `${encrypted.length} of ${channels.length} channels ${encrypted.length === 1 ? "is" : "are"} now`; return (

Conventional Channels

{encrypted.length > 0 && (

{subject} encrypted — those calls can't be decoded, so nothing from{" "} {encrypted.length === 1 ? "it" : "them"} is recorded. Nothing to fix on the node {all ? "; assign this node a different system." : "; clear calls are still recorded."}

)}
); }