"use client"; import { useRouter } from "next/navigation"; import { useState } from "react"; export function CompareForm({ snapshots }: { snapshots: { id: string; label: string }[] }) { const router = useRouter(); const [a, setA] = useState(snapshots[1]?.id ?? ""); const [b, setB] = useState(snapshots[0]?.id ?? ""); if (snapshots.length < 2) return

At least two snapshots are needed to compare.

; const sel = "h-8 w-full rounded-md border border-line bg-panel px-2 font-mono text-[12px]"; return (
{ e.preventDefault(); if (a && b && a !== b) router.push(`/compare?a=${a}&b=${b}`); }} >
); }