SPB Git forge
3commits 1branches 0releases
417.0 KBsize
maindefault branch
10 days agolast push
TypeScript 66.5% Python 30.9% JavaScript 1.4% CSS 0.7%
1.9 KB · 29 lines tsx
Raw Blame History
1import Link from 'next/link';2import { Stat } from '@/components/ui/section';3import { fmtInt } from '@/lib/format';4import { routes } from '@/lib/site';5import type { HomePayload } from '@/lib/types';67/** Headline metrics strip — one hairline row, big tabular numbers, no cards. */8export function HeadlineMetrics({ home }: { home: HomePayload }) {9  const s = home.stats;10  const items: { label: string; value: string; hint: string; href: string }[] = [11    { label: 'Payloads · 30 d', value: fmtInt(s.payloads_launched_30d), hint: `${fmtInt(home.launches.last_30d)} launches`, href: routes.launches() },12    { label: 'Payloads · YTD', value: fmtInt(s.payloads_launched_ytd), hint: `${fmtInt(home.launches.ytd)} launches`, href: routes.launches() },13    { label: 'Payloads · 365 d', value: fmtInt(s.payloads_launched_365d), hint: `${fmtInt(home.launches.last_365d)} launches`, href: routes.launches() },14    { label: 'Decays · 30 d', value: fmtInt(s.decayed_last_30d), hint: `${fmtInt(s.decayed_last_365d)} in 365 d`, href: routes.reentries() },15    { label: 'Debris on orbit', value: fmtInt(s.debris_on_orbit), hint: 'catalogued fragments', href: routes.debris() },16    { label: 'Rocket bodies', value: fmtInt(s.rocket_bodies_on_orbit), hint: 'on orbit', href: routes.debris() },17    { label: 'With element sets', value: fmtInt(s.with_elements), hint: 'tracked live', href: routes.explore() },18  ];19  return (20    <div className="grid grid-cols-2 gap-x-4 gap-y-6 border-b border-rule py-8 sm:grid-cols-4 lg:grid-cols-7">21      {items.map((it) => (22        <Link key={it.label} href={it.href} className="group min-w-0 border-l border-rule pl-3 odd:border-0 odd:pl-0 sm:odd:border-l sm:odd:pl-3 sm:[&:nth-child(4n+1)]:border-0 sm:[&:nth-child(4n+1)]:pl-0 lg:[&:nth-child(4n+1)]:border-l lg:[&:nth-child(4n+1)]:pl-3 lg:first:border-0 lg:first:pl-0">23          <Stat label={it.label} value={it.value} hint={it.hint} />24        </Link>25      ))}26    </div>27  );28}29