SPB Git forge

spb/market-atlas

Public
12commits 1branches 0releases
1.1 MBsize
maindefault branch
10 days agolast push
TypeScript 96.7% SQL 1.6% CSS 0.8% JavaScript 0.5%
1.7 KB · 31 lines tsx
Raw Blame History
1import type { Metadata } from "next";2import Link from "next/link";3import { Page, PageHeader } from "@/components/ui/section";4import { StatusBadge } from "@/components/ui/status-badge";5import { api } from "@/lib/api";6import type { StatusReport } from "@/lib/types";78export const metadata: Metadata = { title: "Status", description: "Operational status of Market Atlas components.", alternates: { canonical: "/status" } };9export const dynamic = "force-dynamic";1011export default async function StatusPage() {12  const s = await api<StatusReport>("/v1/status");13  const worst = s.components.some((c) => c.status === "outage") ? "outage" : s.components.some((c) => c.status === "degraded") ? "degraded" : "operational";14  return (15    <Page>16      <PageHeader kicker="Status" title={worst === "operational" ? "All systems operational" : worst === "degraded" ? "Partial degradation" : "Service disruption"} lead={`Market Atlas v${s.version} · ${s.connectors.healthy} of ${s.connectors.total} connectors healthy. Source-group status reflects whether at least one connector of the group is delivering.`} actions={<StatusBadge status={worst} />} />17      <ul className="divide-y divide-rule rounded-md border border-rule bg-surface">18        {s.components.map((c) => (19          <li key={c.id} className="flex items-center justify-between px-4 py-3 text-sm">20            <span>{c.name}</span>21            <StatusBadge status={c.status} />22          </li>23        ))}24      </ul>25      <p className="mt-4 text-xs text-ink-3">26        Detailed connector metrics and incidents: <Link href="/data-health" className="text-accent hover:underline">data health</Link>. This page intentionally omits infrastructure details.27      </p>28    </Page>29  );30}31