handle change data and update data in dashboard page for all tabs
This commit is contained in:
@@ -4,7 +4,9 @@ import Head from "@/components/dashboard/userAccount/components/Head";
|
||||
import ModalAddRelatives from "./modal";
|
||||
import ItemRelatives from "./ItemRelatives";
|
||||
|
||||
function Relatives({ data, changeData }) {
|
||||
function Relatives({ data, changeData, loading, updateData }) {
|
||||
const { other } = data;
|
||||
const { relatives } = other && other[0];
|
||||
const tableHead = ["ردیف", "نام", "نسبت", "شماره تماس", "آدرس", ""];
|
||||
const centerTable = [0];
|
||||
const [open, setOpen] = useState(false);
|
||||
@@ -14,17 +16,19 @@ function Relatives({ data, changeData }) {
|
||||
<Head text="لیست بستگان">
|
||||
<ModalAddRelatives
|
||||
open={open}
|
||||
loading={loading}
|
||||
setOpen={setOpen}
|
||||
changeData={changeData}
|
||||
updateData={updateData}
|
||||
/>
|
||||
</Head>
|
||||
{data.medications.length ? (
|
||||
{relatives.length ? (
|
||||
<CustomTable
|
||||
zeroRadius={true}
|
||||
tableHead={tableHead}
|
||||
centerTable={centerTable}
|
||||
>
|
||||
{data.relatives.map((row, idx) => (
|
||||
{relatives.map((row, idx) => (
|
||||
<ItemRelatives
|
||||
key={idx}
|
||||
row={row}
|
||||
|
||||
Reference in New Issue
Block a user