import type { Metadata } from "next"; import Link from "next/link"; import { Page, PageHeader, Section } from "@/components/ui/section"; import { StatusBadge } from "@/components/ui/status-badge"; import { api } from "@/lib/api"; import type { Country } from "@/lib/types"; type Row = Country & { exchanges: Array<{ id: string; name: string; status: string }>; instruments_tracked: number }; export const metadata: Metadata = { title: "Countries", description: "Market atlas by country: exchanges, indices, rates and currencies observed by Market Atlas.", alternates: { canonical: "/countries" } }; export const dynamic = "force-dynamic"; export default async function CountriesPage() { const rows = await api("/v1/countries"); const regions = [...new Set(rows.map((r) => r.region))].sort(); return ( {regions.map((region) => (
    {rows .filter((r) => r.region === region) .sort((a, b) => b.instruments_tracked - a.instruments_tracked || a.name.localeCompare(b.name)) .map((r) => (
  • {r.name} {r.code} · {r.currency ?? "—"}
    {r.exchanges.slice(0, 3).map((e) => ( {e.name} ))} {!r.exchanges.length && no venue in the atlas}
    {r.instruments_tracked.toLocaleString("en-US")} instruments tracked
  • ))}
))}
); }