import { useState } from "react"; import type { ReactNode } from "react"; export function ResolvedActions( { className, disabled, note, onDiscard, onReopen, submitting }: { className?: string; /** Quiet card metadata that leads the footer, opposite the actions. */ note?: ReactNode; disabled: boolean; onDiscard?: () => void; onReopen?: () => void; submitting: boolean; }, ) { let [confirming, setConfirming] = useState(false); let keep = () => setConfirming(false); let beginResolvedDiscard = () => setConfirming(true); let confirmResolvedDiscard = () => onDiscard?.(); if (!onDiscard && !onReopen && !note) return null; return ( ); }