import { useRef } from "react" import { X } from "lucide-react" export interface CustomDialogProps { type: "alert" | "confirm" | "prompt" title: string message: string defaultValue?: string autoValue?: string autoLabel?: string onConfirm: (val?: string) => void onCancel?: () => void } export function CustomDialog({ type, title, message, defaultValue, autoValue, autoLabel, onConfirm, onCancel }: CustomDialogProps) { const inputRef = useRef(null) return (

{title}

{/* whitespace-pre-line + Scroll: mehrzeilige Botschaften (z. B. Dubletten-Vorschau, Annehmen-Warnungen) sauber rendern statt zu einer Wurst zusammenzufallen. */}

{message}

{type === "prompt" && (
{ if (e.key === "Enter") { onConfirm(inputRef.current?.value) } }} /> {autoValue !== undefined && ( )}
)}
{(type === "confirm" || type === "prompt") && ( )}
) }