import { Button, Input, Modal } from "antd"; import WaiterRewardingIcon from "components/Icons/waiter/WaiterRewardingIcon"; import { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; interface TipDialogProps { isOpen: boolean; onClose: () => void; initialValue: string; onSave: (value: string) => void; } export function TipDialog({ isOpen, onClose, initialValue, onSave, }: TipDialogProps) { const { t } = useTranslation(); const [value, setValue] = useState(initialValue); useEffect(() => { setValue(initialValue); }, [initialValue]); const handleSave = () => { onSave(value); onClose(); }; const handleCancel = () => { setValue(initialValue); onClose(); }; return ( {t("cart.cancel")} , , ]} width={500} destroyOnHidden >

setValue(e.target.value)} placeholder={t("cart.amount")} autoFocus={false} size="large" />
); }