handle all pages dashboard & register api
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import PlusB from "@/components/icons/PlusB";
|
||||
import { Button } from "@mui/material";
|
||||
import React from "react";
|
||||
|
||||
function Head({ text }) {
|
||||
return (
|
||||
<div className="w-full flex mb-[40px] items-center justify-between">
|
||||
<p className="text-[#525252] dark:text-[#A1A1A1] text-[20px] font-bold">
|
||||
{text}
|
||||
</p>
|
||||
<Button
|
||||
className="!bg-[#5559CE] !w-fit !shadow-none !rounded-[4px] !gap-[4px] !text-[#EFEFEF] !text-[14px] md:!text-[16px] !font-medium"
|
||||
variant="contained"
|
||||
>
|
||||
<PlusB />
|
||||
اضافه کردن
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default Head;
|
||||
@@ -11,7 +11,6 @@ function HeadTab({
|
||||
setIsTurnsDetails,
|
||||
components,
|
||||
}) {
|
||||
|
||||
return (
|
||||
<>
|
||||
{isTurnsDetails ? (
|
||||
@@ -50,9 +49,7 @@ function HeadTab({
|
||||
handleChange={handleChange}
|
||||
/>
|
||||
</div>
|
||||
<div className="mt-[24px] sm:mt-[28px] md:mt-[32px] px-0 md:px-[24px]">
|
||||
{components[tab]}
|
||||
</div>
|
||||
<div className="mt-[22px] px-0 md:px-[24px]">{components[tab]}</div>
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
|
||||
@@ -34,6 +34,7 @@ function ContentTabs({
|
||||
}) {
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [tab, setTab] = useState(0);
|
||||
const data = profileData[0];
|
||||
|
||||
const handleChange = (event, newValue) => {
|
||||
// setValue(newValue);
|
||||
@@ -57,12 +58,12 @@ function ContentTabs({
|
||||
// <Comments user={user} loading={loading} />,
|
||||
// <Messages user={user} loading={loading} />,
|
||||
// <NotfoundDashboard />,
|
||||
<Disease data={profileData} />,
|
||||
<Allergies />,
|
||||
<Medications />,
|
||||
<Surgeries />,
|
||||
<FamilyHistory />,
|
||||
<Relatives />,
|
||||
<Disease data={data} />,
|
||||
<Allergies data={data} />,
|
||||
<Medications data={data} />,
|
||||
<Surgeries data={data} />,
|
||||
<FamilyHistory data={data} />,
|
||||
<Relatives data={data} />,
|
||||
];
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,7 +1,68 @@
|
||||
function Allergies() {
|
||||
import CustomTable from "@/app/component/CustomTable";
|
||||
import TextLoading from "@/app/component/loading/Text";
|
||||
import EditB from "@/components/icons/EditB";
|
||||
import TrashB from "@/components/icons/TrashB";
|
||||
import { Button, TableCell, TableRow } from "@mui/material";
|
||||
import Head from "../../components/Head";
|
||||
|
||||
function Allergies({ data }) {
|
||||
const tableHead = ["ردیف", "ماده آلرژیزا", "واکنش", "شدت", ""];
|
||||
const centerTable = [0];
|
||||
|
||||
return (
|
||||
<div>Allergies</div>
|
||||
)
|
||||
<div>
|
||||
<Head text="لیست آلرژی ها" />
|
||||
<CustomTable
|
||||
zeroRadius={true}
|
||||
tableHead={tableHead}
|
||||
centerTable={centerTable}
|
||||
>
|
||||
{data.allergies.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.substance}
|
||||
</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.reaction}
|
||||
</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.severity}
|
||||
</TextLoading>
|
||||
</TableCell>
|
||||
<TableCell
|
||||
className="!pr-[18px] dark:!border-transparent !text-[#616161] dark:!text-[#A1A1A1] !text-[16px] !font-medium !text-nowrap"
|
||||
align="right"
|
||||
>
|
||||
<div className="flex items-center justify-center gap-[4px]">
|
||||
<Button className="!min-w-fit !p-1" variant="text">
|
||||
<TrashB />
|
||||
</Button>
|
||||
<Button className="!min-w-fit !p-1" variant="text">
|
||||
<EditB />
|
||||
</Button>
|
||||
</div>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
</CustomTable>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default Allergies
|
||||
export default Allergies;
|
||||
|
||||
@@ -1,20 +1,23 @@
|
||||
import CustomTable from "@/app/component/CustomTable";
|
||||
import CircularLoading from "@/app/component/loading/Circular";
|
||||
import TextLoading from "@/app/component/loading/Text";
|
||||
import { TableCell, TableRow } from "@mui/material";
|
||||
import EditB from "@/components/icons/EditB";
|
||||
import TrashB from "@/components/icons/TrashB";
|
||||
import { Button, Switch, TableCell, TableRow } from "@mui/material";
|
||||
import Head from "../../components/Head";
|
||||
|
||||
function Disease({ data }) {
|
||||
const tableHead = ["شماره", "اسم", "وضعیت"];
|
||||
const centerTable = [0, 4];
|
||||
const tableHead = ["ردیف", "اسم", "وضعیت", ""];
|
||||
const centerTable = [0];
|
||||
|
||||
return (
|
||||
<div className="hidden md:flex">
|
||||
<div>
|
||||
<Head text="لیست بیماری ها" />
|
||||
<CustomTable
|
||||
zeroRadius={true}
|
||||
tableHead={tableHead}
|
||||
centerTable={centerTable}
|
||||
>
|
||||
{data.map((row, idx) => (
|
||||
{data.disease.map((row, idx) => (
|
||||
<TableRow
|
||||
key={idx}
|
||||
className="!border-0 !border-b !border-[#DBDBDB] dark:!border-transparent"
|
||||
@@ -27,21 +30,29 @@ function Disease({ data }) {
|
||||
{idx + 1}
|
||||
</TextLoading>
|
||||
</TableCell>
|
||||
<TableCell
|
||||
className="!pr-[18px] dark:!border-transparent !text-[#616161] dark:!text-[#A1A1A1] !text-[16px] !font-medium !text-nowrap"
|
||||
align="center"
|
||||
>
|
||||
<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}>
|
||||
{/* {row.status} */}
|
||||
<Switch defaultChecked={row.status === "true"} />
|
||||
</TextLoading>
|
||||
</TableCell>
|
||||
<TableCell
|
||||
className="!pr-[18px] dark:!border-transparent !text-[#616161] dark:!text-[#A1A1A1] !text-[16px] !font-medium !text-nowrap"
|
||||
align="center"
|
||||
align="right"
|
||||
>
|
||||
<TextLoading width={15} height={18} loading={false}>
|
||||
{row.status}
|
||||
</TextLoading>
|
||||
<div className="flex items-center justify-center gap-[4px]">
|
||||
<Button className="!min-w-fit !p-1" variant="text">
|
||||
<TrashB />
|
||||
</Button>
|
||||
<Button className="!min-w-fit !p-1" variant="text">
|
||||
<EditB />
|
||||
</Button>
|
||||
</div>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
|
||||
@@ -1,7 +1,63 @@
|
||||
function FamilyHistory() {
|
||||
import CustomTable from "@/app/component/CustomTable";
|
||||
import TextLoading from "@/app/component/loading/Text";
|
||||
import EditB from "@/components/icons/EditB";
|
||||
import TrashB from "@/components/icons/TrashB";
|
||||
import { Button, TableCell, TableRow } from "@mui/material";
|
||||
import Head from "../../components/Head";
|
||||
|
||||
function FamilyHistory({ data }) {
|
||||
const tableHead = ["ردیف", "بیماری", "نسبت خانوادگی", ""];
|
||||
const centerTable = [0];
|
||||
|
||||
return (
|
||||
<div>FamilyHistory</div>
|
||||
)
|
||||
<div>
|
||||
<Head text="لیست سابقه خانوادگی بیماری" />
|
||||
<CustomTable
|
||||
zeroRadius={true}
|
||||
tableHead={tableHead}
|
||||
centerTable={centerTable}
|
||||
>
|
||||
{data.family_history.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.disease}
|
||||
</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.relation}
|
||||
</TextLoading>
|
||||
</TableCell>
|
||||
<TableCell
|
||||
className="!pr-[18px] dark:!border-transparent !text-[#616161] dark:!text-[#A1A1A1] !text-[16px] !font-medium !text-nowrap"
|
||||
align="right"
|
||||
>
|
||||
<div className="flex items-center justify-center gap-[4px]">
|
||||
<Button className="!min-w-fit !p-1" variant="text">
|
||||
<TrashB />
|
||||
</Button>
|
||||
<Button className="!min-w-fit !p-1" variant="text">
|
||||
<EditB />
|
||||
</Button>
|
||||
</div>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
</CustomTable>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default FamilyHistory
|
||||
export default FamilyHistory;
|
||||
|
||||
@@ -1,7 +1,68 @@
|
||||
function Medications() {
|
||||
import CustomTable from "@/app/component/CustomTable";
|
||||
import TextLoading from "@/app/component/loading/Text";
|
||||
import EditB from "@/components/icons/EditB";
|
||||
import TrashB from "@/components/icons/TrashB";
|
||||
import { Button, TableCell, TableRow } from "@mui/material";
|
||||
import Head from "../../components/Head";
|
||||
|
||||
function Medications({ data }) {
|
||||
const tableHead = ["ردیف", "نام دارو", "دوز مصرفی", "تعداد و زمان مصرف", ""];
|
||||
const centerTable = [0];
|
||||
|
||||
return (
|
||||
<div>Medications</div>
|
||||
)
|
||||
<div>
|
||||
<Head text="لیست دارو های مصرفی" />
|
||||
<CustomTable
|
||||
zeroRadius={true}
|
||||
tableHead={tableHead}
|
||||
centerTable={centerTable}
|
||||
>
|
||||
{data.medications.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}>
|
||||
{row.dose}
|
||||
</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.frequency}
|
||||
</TextLoading>
|
||||
</TableCell>
|
||||
<TableCell
|
||||
className="!pr-[18px] dark:!border-transparent !text-[#616161] dark:!text-[#A1A1A1] !text-[16px] !font-medium !text-nowrap"
|
||||
align="right"
|
||||
>
|
||||
<div className="flex items-center justify-center gap-[4px]">
|
||||
<Button className="!min-w-fit !p-1" variant="text">
|
||||
<TrashB />
|
||||
</Button>
|
||||
<Button className="!min-w-fit !p-1" variant="text">
|
||||
<EditB />
|
||||
</Button>
|
||||
</div>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
</CustomTable>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default Medications
|
||||
export default Medications;
|
||||
|
||||
@@ -1,7 +1,84 @@
|
||||
function Relatives() {
|
||||
import CustomTable from "@/app/component/CustomTable";
|
||||
import TextLoading from "@/app/component/loading/Text";
|
||||
import EditB from "@/components/icons/EditB";
|
||||
import TrashB from "@/components/icons/TrashB";
|
||||
import { Button, TableCell, TableRow, Tooltip } from "@mui/material";
|
||||
import Head from "../../components/Head";
|
||||
|
||||
function Relatives({ data }) {
|
||||
const tableHead = ["ردیف", "نام", "نسبت", "شماره تماس", "ایمیل", "آدرس", ""];
|
||||
const centerTable = [0];
|
||||
|
||||
return (
|
||||
<div>Relatives</div>
|
||||
)
|
||||
<div>
|
||||
<Head text="لیست بستگان" />
|
||||
<CustomTable
|
||||
zeroRadius={true}
|
||||
tableHead={tableHead}
|
||||
centerTable={centerTable}
|
||||
>
|
||||
{data.relatives.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}>
|
||||
{row.relation}
|
||||
</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.contact.phone?.replace("+", "")}+`}
|
||||
</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.contact.email}
|
||||
</TextLoading>
|
||||
</TableCell>
|
||||
<TableCell className="!pr-[18px] dark:!border-transparent !text-[#616161] dark:!text-[#A1A1A1] !text-[16px] !font-medium !text-nowrap">
|
||||
<Tooltip title={row.contact.address || ""} arrow>
|
||||
<div className="truncate max-w-[150px] cursor-default">
|
||||
<TextLoading width={15} height={18} loading={false}>
|
||||
{(row.contact.address || "").substring(0, 15)}
|
||||
{row.contact.address?.length > 15 ? "…" : ""}
|
||||
</TextLoading>
|
||||
</div>
|
||||
</Tooltip>
|
||||
</TableCell>
|
||||
|
||||
<TableCell
|
||||
className="!pr-[18px] dark:!border-transparent !text-[#616161] dark:!text-[#A1A1A1] !text-[16px] !font-medium !text-nowrap"
|
||||
align="right"
|
||||
>
|
||||
<div className="flex items-center justify-center gap-[4px]">
|
||||
<Button className="!min-w-fit !p-1" variant="text">
|
||||
<TrashB />
|
||||
</Button>
|
||||
<Button className="!min-w-fit !p-1" variant="text">
|
||||
<EditB />
|
||||
</Button>
|
||||
</div>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
</CustomTable>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default Relatives
|
||||
export default Relatives;
|
||||
|
||||
@@ -1,7 +1,77 @@
|
||||
function Surgeries() {
|
||||
import CustomTable from "@/app/component/CustomTable";
|
||||
import TextLoading from "@/app/component/loading/Text";
|
||||
import EditB from "@/components/icons/EditB";
|
||||
import TrashB from "@/components/icons/TrashB";
|
||||
import { Button, TableCell, TableRow } from "@mui/material";
|
||||
import Head from "../../components/Head";
|
||||
|
||||
function Surgeries({ data }) {
|
||||
const tableHead = [
|
||||
"ردیف",
|
||||
"نوع جراحی",
|
||||
"نام بیمارستان",
|
||||
"سال انجام جراحی",
|
||||
"",
|
||||
];
|
||||
const centerTable = [0, 3];
|
||||
|
||||
return (
|
||||
<div>Surgeries</div>
|
||||
)
|
||||
<div>
|
||||
<Head text="لیست جراحی ها" />
|
||||
<CustomTable
|
||||
zeroRadius={true}
|
||||
tableHead={tableHead}
|
||||
centerTable={centerTable}
|
||||
>
|
||||
{data.surgeries.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.type}
|
||||
</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.hospital}
|
||||
</TextLoading>
|
||||
</TableCell>
|
||||
<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}>
|
||||
{row.year}
|
||||
</TextLoading>
|
||||
</TableCell>
|
||||
<TableCell
|
||||
className="!pr-[18px] dark:!border-transparent !text-[#616161] dark:!text-[#A1A1A1] !text-[16px] !font-medium !text-nowrap"
|
||||
align="right"
|
||||
>
|
||||
<div className="flex items-center justify-center gap-[4px]">
|
||||
<Button className="!min-w-fit !p-1" variant="text">
|
||||
<TrashB />
|
||||
</Button>
|
||||
<Button className="!min-w-fit !p-1" variant="text">
|
||||
<EditB />
|
||||
</Button>
|
||||
</div>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
</CustomTable>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default Surgeries
|
||||
export default Surgeries;
|
||||
|
||||
Reference in New Issue
Block a user