cart refactor code

This commit is contained in:
2025-10-05 22:35:22 +03:00
parent 9903387e87
commit 8df4477ac5
9 changed files with 402 additions and 312 deletions

View 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>
);
}