import { Card } from "antd";
import { ProBottomSheet } from "components/ProBottomSheet/ProBottomSheet.tsx";
import { useState } from "react";
import { useTranslation } from "react-i18next";
import BackIcon from "components/Icons/BackIcon";
import NextIcon from "components/Icons/NextIcon";
import ProTitle from "components/ProTitle";
import { useAppSelector } from "redux/hooks";
import { CustomAmountChoiceBottomSheet } from "./CustomAmountChoiceBottomSheet";
import { EqualltyChoiceBottomSheet } from "./EqualltyChoiceBottomSheet";
import { PayForYourItemsChoiceBottomSheet } from "./PayForYourItemsChoiceBottomSheet";
import styles from "./SplitBill.module.css";
interface SplitBillChoiceBottomSheetProps {
isOpen: boolean;
onClose: () => void;
onSave?: (value: string) => void;
onSelectSplitWay?: (way: "customAmount" | "equality" | "payForItems") => void;
}
export function SplitBillChoiceBottomSheet({
isOpen,
onClose,
onSelectSplitWay,
}: SplitBillChoiceBottomSheetProps) {
const { t } = useTranslation();
const { isRTL } = useAppSelector((state) => state.locale);
const [isCustomAmountOpen, setIsCustomAmountOpen] = useState(false);
const [isEqualityOpen, setIsEqualityOpen] = useState(false);
const [isPayForItemsOpen, setIsPayForItemsOpen] = useState(false);
const handleCancel = () => {
onClose();
};
const handleCustomAmountClick = () => {
onSelectSplitWay?.("customAmount");
onClose();
setIsCustomAmountOpen(true);
};
const handleEqualityClick = () => {
onSelectSplitWay?.("equality");
onClose();
setIsEqualityOpen(true);
};
const handlePayForItemsClick = () => {
onSelectSplitWay?.("payForItems");
onClose();
setIsPayForItemsOpen(true);
};
return (
<>
{t("splitBill.payAsCustomAmount")}
{isRTL ? (
) : (
)}
{t("splitBill.divideTheBillEqually")}
{isRTL ? (
) : (
)}
{t("splitBill.payForYourItems")}
{isRTL ? (
) : (
)}
setIsCustomAmountOpen(false)}
/>
setIsEqualityOpen(false)}
/>
setIsPayForItemsOpen(false)}
/>
>
);
}