import Link from "next/link"; import type { Metadata } from "next"; import { Bar, Empty, Flag, PageHeader, Panel, Table, Td } from "@/components/ui"; import { api } from "@/lib/api"; import { fmtInt } from "@/lib/format"; export const dynamic = "force-dynamic"; export const metadata: Metadata = { title: "Countries", description: "Country desks: government, business, infrastructure, health, media, cyber, AI and science signals for every country WebSensor covers.", alternates: { canonical: "/country" } }; export default async function CountriesPage() { const { items } = await api.countries(); const totals = items.reduce((a, c) => ({ sources: a.sources + c.sources, events: a.events + c.events_24h, breaking: a.breaking + c.breaking_24h }), { sources: 0, events: 0, breaking: 0 }); const max = Math.max(1, ...items.map((c) => c.events_24h)); return ( <> {items.length === 0 ? ( Country desks appear once sources carry a country. ) : ( {items.map((c) => ( ))}
{c.flag || } {c.name} {c.country} {fmtInt(c.sources)} {fmtInt(c.events_24h)}
{fmtInt(c.breaking_24h)} desk →
)}
); }