import { ProBottomSheet } from "components/ProBottomSheet/ProBottomSheet.tsx";
import Content from "pages/cart/components/timeEstimate/Content.tsx";
import { useTranslation } from "react-i18next";

interface EstimateTimeBottomSheetProps {
  isOpen: boolean;
  onClose: () => void;
  onSave: (date: Date, time: string) => void;
  initialDate?: Date;
}

export function BottomSheet({
  isOpen,
  onClose,
  onSave,
  initialDate = new Date(),
}: EstimateTimeBottomSheetProps) {
  const { t } = useTranslation();

  return (
    <ProBottomSheet
      isOpen={isOpen}
      onClose={onClose}
      title={t("cart.selectTimeEstimate")}
      showCloseButton={true}
      initialSnap={1}
      height={555}
      snapPoints={["65vh"]}
    >
      <Content onSave={onSave} initialDate={initialDate} onClose={onClose} />
    </ProBottomSheet>
  );
}
