import { useState, useEffect } from 'react' import { createRoot } from 'react-dom/client' import { colors } from '../constants/theme' interface ThemeColors { bg: string border: string text: string hover: string selected: string textMuted: string } interface ModalProps { title?: string message: string type: 'alert' | 'prompt' | 'confirm' defaultValue?: string onConfirm: (value?: string) => void onCancel: () => void theme: ThemeColors } function Modal({ title, message, type, defaultValue = '', onConfirm, onCancel, theme }: ModalProps) { const [inputValue, setInputValue] = useState(defaultValue) // Focus input on mount useEffect(() => { if (type === 'prompt') { const input = document.getElementById('custom-modal-input') if (input) input.focus() } }, [type]) const handleConfirm = () => { onConfirm(type === 'prompt' ? inputValue : undefined) } return (