handle change data and update data in dashboard page for all tabs

This commit is contained in:
Ehsan
2025-06-11 16:52:01 +03:30
parent 72ed07071c
commit bf64271d14
26 changed files with 235 additions and 118 deletions
@@ -3,7 +3,7 @@ import TextLoading from "@/app/component/loading/Text";
import { TableCell, TableRow } from "@mui/material";
import ModalEditItem from "@/components/dashboard/userAccount/components/modal/ModalEditItem";
import Content from "./modal/Content";
import { useState } from "react";
import { useEffect, useState } from "react";
function ItemRelatives({ row, idx, changeData }) {
const contentData = {
@@ -12,9 +12,19 @@ function ItemRelatives({ row, idx, changeData }) {
phone: row.contact.phone,
address: row.contact.address,
};
const [data, setData] = useState(contentData);
const resetData = () => setData(contentData);
useEffect(() => {
setData({
name: row.name,
relation: row.relation,
phone: row.contact.phone,
address: row.contact.address,
});
}, [row]);
return (
<TableRow
key={idx}