import { useId, useState } from "react" import { useParams } from "react-router-dom" import { AlertTriangle, Loader2, Play, RefreshCw, TriangleAlert } from "lucide-react" import { DiffView } from "@/components/DiffView" import { DomainHistory } from "@/components/DomainHistory" import { Button } from "@/components/ui/button" import { Checkbox } from "@/components/ui/checkbox" import { Label } from "@/components/ui/label" import { useApplyDomain, useCheckDomain } from "@/hooks/useApi" import { cn } from "@/lib/utils" export function DomainDiffPage() { const { id = "" } = useParams() const check = useCheckDomain(id) const apply = useApplyDomain(id) const [applyPrunes, setApplyPrunes] = useState(false) const pruneCheckboxId = useId() const changeset = check.data const hasPrunes = (changeset?.prunes.length ?? 0) > 0 const hasUpdates = (changeset?.updates.length ?? 0) > 0 const pruneWarning = applyPrunes && hasPrunes function onApply() { apply.mutate({ applyUpdates: true, applyPrunes }) } return (