import { ReactNode, useState } from 'react'; import { useTranslator } from '@luckystack/core/client'; export interface ConfirmMenuProps { title: string; content?: string | ReactNode; /** When set, the user must type this exact string before the confirm button enables. */ input?: string; /** Called with `true` (confirm) or `false` (cancel). The caller is responsible for closing the menu. */ resolve: (confirmed: boolean) => void; } export function ConfirmMenu({ title, content, input, resolve }: ConfirmMenuProps) { const translate = useTranslator(); const [inputValue, setInputValue] = useState(''); const inputRequiredAndInvalid = input ? input !== inputValue : false; return (
); }