"use client"; import { useState } from "react"; import { useRouter } from "next/navigation"; import { buttonVariants } from "@/components/ui/button"; // Copy the manifest into revisions/ with an optional label. The page re-renders // on success, so the new snapshot appears in the list with its (empty) diff. export default function SnapshotButton({ project }: { project: string }) { const router = useRouter(); const [label, setLabel] = useState(""); const [busy, setBusy] = useState(false); const [error, setError] = useState(null); return ( setLabel(e.target.value)} placeholder="label (optional)" aria-label="snapshot label" data-snapshot-label className="w-36 rounded border border-[var(--color-line)] bg-[var(--color-ink)] px-1.5 py-0.5 font-mono text-[11px] text-[var(--color-text)] outline-none focus:border-[var(--color-sel)]" /> {error && {error}} ); }