import CustomTable from "@/app/component/CustomTable"; import TextLoading from "@/app/component/loading/Text"; import { Switch, TableCell, TableRow } from "@mui/material"; import Head from "@/components/dashboard/userAccount/components/Head"; import UpdateBtn from "@/components/dashboard/userAccount/components/UpdateBtn"; function Disease({ data, setData, updateData }) { const { other } = data; const { disease } = other && other[0]; const tableHead = ["ردیف", "اسم", "وضعیت", ""]; const centerTable = [0]; const changeData = (id, payload) => { const newDisease = data.other[0].disease?.map((item, index) => index === id ? { ...item, status: payload } : item ); const newData = { ...data, other: [ { ...data.other[0], disease: newDisease, }, ], }; setData(newData); }; return (