"use client"; import { Download } from "lucide-react"; import { GlassPanel } from "@/components/primitives"; import { SectionHeader } from "@/components/shared"; import { downloadCsv } from "@/lib/csv"; import { formatNumber } from "@/lib/format"; import type { FlaggedChannel } from "@/lib/types"; export function TopChannels({ channels }: { channels: FlaggedChannel[] }) { const max = channels.reduce((m, c) => Math.max(m, c.flagged_count), 0); return ( 0 ? ( ) : null } /> {channels.length === 0 ? (

No flagged activity in the selected period.

) : (
{channels.map((c) => { const pct = max > 0 ? Math.max(2, (c.flagged_count / max) * 100) : 0; return (
{c.channel_name ?? c.channel_id}
{formatNumber(c.flagged_count)}
); })}
)} ); }