import type { Pulse } from "@dci/core"; import type { Metadata } from "next"; import Link from "next/link"; import { Breadcrumbs } from "@/components/entity/breadcrumbs"; import { SectionNav } from "@/components/entity/section-nav"; import { SourcesFooter } from "@/components/entity/sources-footer"; import { EventList } from "@/components/event-list"; import { ApiNote, CounterGrid, HonestEmpty, type CounterItem } from "@/components/intelligence/shared"; import { Page, PageHeader, Section } from "@/components/ui/card"; import { CountryFlag } from "@/components/ui/country-flag"; import { SegmentedControl } from "@/components/ui/segmented"; import { ErrorState, OfflineNotice } from "@/components/ui/states"; import { RowLink, TBody, THead, Table, Td, Th, Tr } from "@/components/ui/table"; import { api } from "@/lib/api"; import { countryName, fmtDateTimeUtc, fmtInt } from "@/lib/format"; import { routes } from "@/lib/routes"; import { pageMetadata } from "@/lib/seo"; export const revalidate = 60; type Window = Pulse["window"]; const WINDOWS: Array<{ value: Window; label: string; suffix: string }> = [ { value: "24h", label: "24 h", suffix: "in the last 24 hours" }, { value: "7d", label: "7 days", suffix: "in the last 7 days" }, { value: "30d", label: "30 days", suffix: "in the last 30 days" }, ]; const isWindow = (v: unknown): v is Window => v === "24h" || v === "7d" || v === "30d"; export const metadata: Metadata = pageMetadata({ title: "Pulse", description: "What changed in the global data center index over the last 24 hours, 7 days or 30 days: new projects, construction starts, openings, announced MW, new markets, power and grid events — deterministic counts from detected changes.", path: routes.pulse(), }); export default async function PulsePage({ searchParams }: { searchParams: Promise> }) { const sp = await searchParams; const raw = typeof sp.window === "string" ? sp.window : undefined; const window: Window = isWindow(raw) ? raw : "7d"; const win = WINDOWS.find((w) => w.value === window)!; const r = await api.pulse(window); const header = ( ({ value: w.value, label: w.label, href: w.value === "7d" ? routes.pulse() : routes.pulse(`window=${w.value}`) }))} />} /> ); if (!r.ok) { return ( {header} ); } const d = r.data; const methodology = typeof r.meta?.methodology === "string" ? r.meta.methodology : null; const counters: CounterItem[] = [ { key: "newProjects", value: d.newProjects, label: "new projects detected", href: routes.projects() }, { key: "projectsEnteredConstruction", value: d.projectsEnteredConstruction, label: "projects entered construction" }, { key: "facilitiesOpened", value: d.facilitiesOpened, label: "facilities opened" }, { key: "newlyAnnouncedMw", value: d.newlyAnnouncedMw, label: "of newly announced capacity (≈ planned)", format: "mw" }, { key: "constructionStartedMw", value: d.constructionStartedMw, label: "of capacity started construction", format: "mw" }, { key: "cloudRegionsAnnounced", value: d.cloudRegionsAnnounced, label: "cloud regions announced or launched", href: routes.cloudRegions() }, { key: "powerAgreements", value: d.powerAgreements, label: "power agreements detected", href: routes.power() }, { key: "gridConstraintEvents", value: d.gridConstraintEvents, label: "grid constraint events", href: routes.power() }, { key: "acquisitions", value: d.acquisitions, label: "acquisitions detected", href: routes.live("type=acquisition") }, { key: "financingEvents", value: d.financingEvents, label: "financing events" }, { key: "newFacilitiesIndexed", value: d.newFacilitiesIndexed, label: "facilities newly indexed", note: "includes the initial import of a source when it falls in the window" }, { key: "capacityChanges", value: d.capacityChanges, label: "capacity figures changed", href: routes.live("type=capacity_changed,planned_capacity_changed") }, { key: "eventsTotal", value: d.eventsTotal, label: "changes detected in total", href: routes.live() }, ]; const sections = [ { id: "counters", label: "Counters" }, { id: "markets", label: "New markets", count: d.operatorsNewMarkets.length }, { id: "major", label: "Major events", count: d.majorEvents.length }, { id: "by-country", label: "By country", count: d.byCountry.length }, { id: "by-operator", label: "By operator", count: d.byOperator.length }, ]; return ( {header}

Changes detected since {fmtDateTimeUtc(d.since)} · window {win.label}

{d.operatorsNewMarkets.length === 0 ? ( ) : (
    {d.operatorsNewMarkets.map((x, i) => (
  • {x.operator.name} → {x.market ? ( {x.countryIso2 && } {x.market.name} ) : x.countryIso2 ? ( {countryName(x.countryIso2)} (country, no market) ) : ( market unknown )}
  • ))}
)}
All major changes →}>
{d.byCountry.length === 0 ? ( ) : ( {d.byCountry.map((c) => ( ))}
Country Changes New projects
{c.name} {fmtInt(c.events)} {fmtInt(c.newProjects)}
)}
{d.byOperator.length === 0 ? ( ) : ( {d.byOperator.map((o) => ( ))}
Operator Changes New projects
{o.name} {fmtInt(o.events)} {fmtInt(o.newProjects)}
)}
); }