import { Button, Divider, Form, Input } from "antd"; import { RoomDetailsType } from "features/order/orderSlice"; import { useEffect } from "react"; import { useTranslation } from "react-i18next"; import { ProBottomSheet } from "../ProBottomSheet/ProBottomSheet"; import ProRatioGroups from "../ProRatioGroups/ProRatioGroups"; const { TextArea } = Input; interface RoomBottomSheetProps { isOpen: boolean; onClose: () => void; initialValue: RoomDetailsType | null; onSave: (value: RoomDetailsType) => void; } export function RoomBottomSheet({ isOpen, onClose, initialValue, onSave, }: RoomBottomSheetProps) { const { t } = useTranslation(); const [roomForm] = Form.useForm(); useEffect(() => { roomForm.setFieldsValue(initialValue); }, [initialValue, roomForm]); const handleSave = () => { onSave(roomForm.getFieldsValue()); roomForm.resetFields(); onClose(); }; const handleCancel = () => { roomForm.setFieldsValue(initialValue); roomForm.resetFields(); onClose(); }; return (
{" "}