52 lines
1.8 KiB
JavaScript
52 lines
1.8 KiB
JavaScript
import CustomTable from "@/app/component/CustomTable";
|
|
import TextLoading from "@/app/component/loading/Text";
|
|
import { Switch, TableCell, TableRow } from "@mui/material";
|
|
import Head from "../../components/Head";
|
|
import UpdateBtn from "../../components/UpdateBtn";
|
|
|
|
function Disease({ data }) {
|
|
const tableHead = ["ردیف", "اسم", "وضعیت", ""];
|
|
const centerTable = [0];
|
|
|
|
return (
|
|
<div>
|
|
<Head text="لیست بیماری ها" add={false}>
|
|
<UpdateBtn />
|
|
</Head>
|
|
<CustomTable
|
|
zeroRadius={true}
|
|
tableHead={tableHead}
|
|
centerTable={centerTable}
|
|
>
|
|
{data.disease.map((row, idx) => (
|
|
<TableRow
|
|
key={idx}
|
|
className="!border-0 !border-b !border-[#DBDBDB] dark:!border-transparent"
|
|
>
|
|
<TableCell
|
|
className="!pr-[18px] dark:!border-transparent !text-[#616161] dark:!text-[#A1A1A1] !text-[16px] !font-medium !text-nowrap"
|
|
align="center"
|
|
>
|
|
<TextLoading width={15} height={18} loading={false}>
|
|
{idx + 1}
|
|
</TextLoading>
|
|
</TableCell>
|
|
<TableCell className="!pr-[18px] dark:!border-transparent !text-[#616161] dark:!text-[#A1A1A1] !text-[16px] !font-medium !text-nowrap">
|
|
<TextLoading width={15} height={18} loading={false}>
|
|
{row.name}
|
|
</TextLoading>
|
|
</TableCell>
|
|
<TableCell className="!pr-[18px] dark:!border-transparent !text-[#616161] dark:!text-[#A1A1A1] !text-[16px] !font-medium !text-nowrap">
|
|
<TextLoading width={15} height={18} loading={false}>
|
|
<Switch defaultChecked={row.status === "true"} />
|
|
</TextLoading>
|
|
</TableCell>
|
|
</TableRow>
|
|
))}
|
|
</CustomTable>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default Disease;
|