import { 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: string, time: string) => void;
}

export function Dialog({ isOpen, onClose, onSave }: EstimateTimeDialogProps) {
  const { t } = useTranslation();

  return (
    <Modal
      title={t("cart.selectTimeEstimate")}
      open={isOpen}
      onCancel={onClose}
      footer={[]}
      width={500}
      destroyOnHidden
    >
      <Content onSave={onSave} onClose={onClose} />
    </Modal>
  );
}
