change fields component & handle edit, delete, add data and save & change functional page doctor

This commit is contained in:
Ehsan
2025-07-02 01:58:44 +03:30
parent 43eb9c2b78
commit 04d3e38859
22 changed files with 290 additions and 313 deletions
@@ -5,8 +5,7 @@ import ModalAddHistory from "./modal";
import ItemHistory from "./ItemHistory";
function FamilyHistory({ data, changeData, loading, updateData }) {
const family_history =
data && data.other && data.other[0] && data.other[0].family_history;
const family_history = data && data.other && data.other.family_history;
const tableHead = ["ردیف", "بیماری", "نسبت خانوادگی", ""];
const centerTable = [0];
const [open, setOpen] = useState(false);
@@ -22,13 +21,13 @@ function FamilyHistory({ data, changeData, loading, updateData }) {
updateData={updateData}
/>
</Head>
{family_history.length ? (
{family_history?.length ? (
<CustomTable
zeroRadius={true}
tableHead={tableHead}
centerTable={centerTable}
>
{family_history.map((row, idx) => (
{family_history?.map((row, idx) => (
<ItemHistory
key={idx}
row={row}