spb/satelliteindex
Public
TypeScript 66.5%
Python 30.9%
JavaScript 1.4%
CSS 0.7%
1import type { Metadata } from 'next';2import { LatestLaunches, RecentEvents, RecentReentries } from '@/components/home/activity';3import { OrbitalDensity } from '@/components/home/density';4import { FeaturedObjects } from '@/components/home/featured';5import { HomeHero } from '@/components/home/hero';6import { HeadlineMetrics } from '@/components/home/metrics';7import { TopConstellations, TopCountries, TopOperators } from '@/components/home/rankings';8import { ApiTeaser, DataSources } from '@/components/home/sources';9import { Container } from '@/components/ui/section';10import { Unavailable } from '@/components/ui/unavailable';11import { api, safe } from '@/lib/api';12import { fmtAgo, fmtDateTime } from '@/lib/format';13import { DESCRIPTION, SITE_NAME, SITE_URL, TAGLINE } from '@/lib/site';1415export const revalidate = 120;1617export const metadata: Metadata = {18 title: { absolute: `${SITE_NAME} — ${TAGLINE}` },19 description: DESCRIPTION,20 alternates: { canonical: '/' },21 openGraph: { title: `${SITE_NAME} — ${TAGLINE}`, description: DESCRIPTION, url: SITE_URL, type: 'website' },22 twitter: { card: 'summary_large_image', title: `${SITE_NAME} — ${TAGLINE}`, description: DESCRIPTION },23};2425export default async function HomePage() {26 const res = await safe(api.home());27 const home = res?.data ?? null;2829 return (30 <>31 <HomeHero home={home} />32 <Container>33 {!home ? (34 <div className="py-12">35 <Unavailable what="Catalogue statistics" />36 </div>37 ) : (38 <>39 <HeadlineMetrics home={home} />4041 <div className="grid grid-cols-[minmax(0,1fr)] gap-12 py-12 lg:grid-cols-[minmax(0,7fr)_minmax(0,5fr)] lg:gap-16">42 <FeaturedObjects items={home.trending} />43 <TopConstellations items={home.top_constellations} />44 </div>4546 <div className="grid grid-cols-[minmax(0,1fr)] gap-12 border-t border-rule py-12 lg:grid-cols-[minmax(0,1fr)_minmax(0,1fr)] lg:gap-16">47 <LatestLaunches items={home.latest_launches} />48 <RecentEvents items={home.events} />49 </div>5051 <div className="grid grid-cols-[minmax(0,1fr)] gap-12 border-t border-rule py-12 lg:grid-cols-[minmax(0,1fr)_minmax(0,1fr)] lg:gap-16">52 <TopCountries items={home.top_countries} />53 <TopOperators items={home.top_operators} />54 </div>5556 <div className="border-t border-rule py-12">57 <OrbitalDensity buckets={home.orbital_buckets} />58 </div>5960 <div className="border-t border-rule py-12">61 <RecentReentries items={home.reentries} />62 </div>6364 <div className="grid grid-cols-[minmax(0,1fr)] gap-12 border-t border-rule py-12 lg:grid-cols-[minmax(0,6fr)_minmax(0,6fr)] lg:gap-16">65 <DataSources sources={home.sources} />66 <ApiTeaser />67 </div>6869 <p className="mono border-t border-rule py-6 text-2xs text-ink-3">70 Statistics snapshot computed {fmtAgo(home.computed_at)} · {fmtDateTime(home.computed_at)} · page refreshes every 2 min71 </p>72 </>73 )}74 </Container>75 </>76 );77}78