change response file & request get user-profile & change design dashboard page & handle limit page dashboard
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
import CustomTable from "@/app/component/CustomTable";
|
||||
import Head from "@/components/dashboard/userAccount/components/Head";
|
||||
import { useState } from "react";
|
||||
import ItemMedication from "./ItemMedication";
|
||||
import ModalAddMedications from "./modal";
|
||||
|
||||
function Medications({ data, changeData }) {
|
||||
const tableHead = ["ردیف", "نام دارو", "دوز مصرفی", "تعداد و زمان مصرف", ""];
|
||||
const centerTable = [0];
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
return (
|
||||
<div className="opacity-page">
|
||||
<Head text="لیست دارو های مصرفی">
|
||||
<ModalAddMedications
|
||||
open={open}
|
||||
setOpen={setOpen}
|
||||
changeData={changeData}
|
||||
/>
|
||||
</Head>
|
||||
{data.medications.length ? (
|
||||
<CustomTable
|
||||
zeroRadius={true}
|
||||
tableHead={tableHead}
|
||||
centerTable={centerTable}
|
||||
>
|
||||
{data.medications.map((row, idx) => (
|
||||
<ItemMedication
|
||||
key={idx}
|
||||
row={row}
|
||||
idx={idx}
|
||||
changeData={changeData}
|
||||
/>
|
||||
))}
|
||||
</CustomTable>
|
||||
) : (
|
||||
<p className="text-center py-10 text-gray-500">
|
||||
هیچ داروی مصرفی وجود ندارد!
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default Medications;
|
||||
Reference in New Issue
Block a user