import { Modal } from "antd";
import { useTranslation } from "react-i18next";

import PickupEstimateContent from "pages/checkout/components/pickupEstimate/Content.tsx";

interface PickupEstimateDialogProps {
  isOpen: boolean;
  onClose: () => void;
  onSave: (date: string, time: string) => void;
}

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

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