import Circle4PeopleIcon from "components/Icons/tables/Circle4PeopleIcon"; import Rectangle6PeopleIcon from "components/Icons/tables/Rectangle6PeopleIcon"; import Square4PeopleIcon from "components/Icons/tables/Square4PeopleIcon"; import { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import { ProBottomSheet } from "../ProBottomSheet/ProBottomSheet"; import styles from "./CustomBottomSheet.module.css"; interface TablesBottomSheetProps { isOpen: boolean; onClose: () => void; initialValue: string; onSave: (value: string) => void; } export function TablesBottomSheet({ isOpen, onClose, initialValue, onSave, }: TablesBottomSheetProps) { const { t } = useTranslation(); const [value, setValue] = useState(initialValue); useEffect(() => { setValue(initialValue); }, [initialValue]); const handleSave = () => { onSave(value); onClose(); }; const handleCancel = () => { setValue(initialValue); onClose(); }; const tableList = [ { id: 1, name: "Table 1", value: "table1", shape: "rectangle", number: 6, is_booked: true, }, { id: 2, name: "Table 2", value: "table2", shape: "square", number: 4, is_booked: false, }, { id: 3, name: "Table 3", value: "table3", shape: "circle", number: 4, is_booked: false, }, { id: 4, name: "Table 4", value: "table4", shape: "rectangle", number: 6, is_booked: false, }, { id: 5, name: "Table 5", value: "table5", shape: "rectangle", number: 6, is_booked: false, }, { id: 6, name: "Table 6", value: "table6", shape: "rectangle", number: 6, is_booked: false, }, { id: 7, name: "Table 7", value: "table7", shape: "square", number: 4, is_booked: false, }, { id: 8, name: "Table 8", value: "table8", shape: "square", number: 4, is_booked: false, }, { id: 9, name: "Table 9", value: "table9", shape: "circle", number: 4, is_booked: false, }, { id: 10, name: "Table 10", value: "table10", shape: "circle", number: 4, is_booked: false, }, ]; return (
{tableList.map((table) => { if (table.shape === "rectangle") { return (
); } else if (table.shape === "square") { return (
); } else if (table.shape === "circle") { return (
); } })}
); }