import Link from "next/link"; import type { Metadata } from "next"; import { DiffViewer } from "@/components/diff-viewer"; import { Empty, PageHeader, Panel } from "@/components/ui"; import { api } from "@/lib/api"; import { utcDateTime } from "@/lib/format"; export const dynamic = "force-dynamic"; export const metadata: Metadata = { title: "Compare snapshots", robots: { index: false } }; export default async function ComparePage({ searchParams }: { searchParams: Promise<{ a?: string; b?: string }> }) { const { a, b } = await searchParams; const d = a && b ? await api.compare(a, b) : null; return ( <> {utcDateTime(d.a.captured_at)} → {utcDateTime(d.b.captured_at)} : "Compare"} description={d?.a.url ? {d.a.url} : "Provide two snapshot ids (?a=&b=)."} /> {d ? ( ) : ( Snapshots not found. )} ); }