cart refactor code
This commit is contained in:
37
src/pages/cart/components/timeEstimate/Dialog.tsx
Normal file
37
src/pages/cart/components/timeEstimate/Dialog.tsx
Normal file
@@ -0,0 +1,37 @@
|
||||
import { Button, Modal } from "antd";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import Content from "pages/cart/components/timeEstimate/Content.tsx";
|
||||
|
||||
interface EstimateTimeDialogProps {
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
onSave: (date: Date, time: string) => void;
|
||||
initialDate?: Date;
|
||||
}
|
||||
|
||||
export function Dialog({
|
||||
isOpen,
|
||||
onClose,
|
||||
onSave,
|
||||
initialDate = new Date(),
|
||||
}: EstimateTimeDialogProps) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<Modal
|
||||
title={t("cart.selectTimeEstimate")}
|
||||
open={isOpen}
|
||||
onCancel={onClose}
|
||||
footer={[
|
||||
<Button key="cancel" onClick={onClose}>
|
||||
{t("cart.cancel")}
|
||||
</Button>,
|
||||
]}
|
||||
width={500}
|
||||
destroyOnHidden
|
||||
>
|
||||
<Content onSave={onSave} initialDate={initialDate} onClose={onClose} />
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user