import { useRef } from "react"; import { Modal, Button } from "react-bootstrap" type Props = { customerName: string, isOpen: boolean, onClose: () => void, onSave: (customer: string, name?: string, price?: number) => void, initialValues?: { text?: string, price?: string }, } /** Modální dialog pro nastavení příplatků za pizzu. */ export default function PizzaAdditionalFeeModal({ customerName, isOpen, onClose, onSave, initialValues }: Props) { const textRef = useRef(null); const priceRef = useRef(null); const doSubmit = () => { onSave(customerName, textRef.current?.value, parseInt(priceRef.current?.value || "0")); } const handleKeyDown = (e: React.KeyboardEvent) => { if (e.key === 'Enter') { onSave(customerName, textRef.current?.value, parseInt(priceRef.current?.value || "0")); } } return Příplatky za objednávku pro {customerName} Popis:
Cena v Kč:
Je možné zadávat i záporné částky (např. v případě slev)
}