change fields component & handle edit, delete, add data and save & change functional page doctor
This commit is contained in:
@@ -5,8 +5,7 @@ import ItemMedication from "./ItemMedication";
|
||||
import ModalAddMedications from "./modal";
|
||||
|
||||
function Medications({ data, changeData, updateData, loading }) {
|
||||
const medications =
|
||||
data && data.other && data.other[0] && data.other[0].medications;
|
||||
const medications = data && data.other && data.other.medications;
|
||||
const tableHead = ["ردیف", "نام دارو", "دوز مصرفی", "تعداد و زمان مصرف", ""];
|
||||
const centerTable = [0];
|
||||
const [open, setOpen] = useState(false);
|
||||
@@ -22,13 +21,13 @@ function Medications({ data, changeData, updateData, loading }) {
|
||||
changeData={changeData}
|
||||
/>
|
||||
</Head>
|
||||
{medications.length ? (
|
||||
{medications?.length ? (
|
||||
<CustomTable
|
||||
zeroRadius={true}
|
||||
tableHead={tableHead}
|
||||
centerTable={centerTable}
|
||||
>
|
||||
{medications.map((row, idx) => (
|
||||
{medications?.map((row, idx) => (
|
||||
<ItemMedication
|
||||
key={idx}
|
||||
row={row}
|
||||
|
||||
Reference in New Issue
Block a user