From dfff86c4917145dd2b8b298eb1a0ccfa8575c271 Mon Sep 17 00:00:00 2001 From: sonika <> Date: Wed, 6 Sep 2023 22:24:34 +0530 Subject: [PATCH] display add table data --- src/Components/Helper/AddNewTable.tsx | 34 +++++++++++++++---- src/Components/PatientForm/PastTreatment5.tsx | 5 ++- src/Components/PatientForm/PatientForm.tsx | 2 ++ 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/src/Components/Helper/AddNewTable.tsx b/src/Components/Helper/AddNewTable.tsx index d7df8aa..dcfa0b7 100644 --- a/src/Components/Helper/AddNewTable.tsx +++ b/src/Components/Helper/AddNewTable.tsx @@ -13,7 +13,27 @@ interface DataTableProps { onAddRow: () => void; } -const DataTable: React.FC= () => { +type Props={ + handleFormSection5Data:( + generalHealth: string|undefined, + presentProblemBefore: string|undefined, + ifYespresentProblemBefore:string|undefined, + ifYestreatmentProvided: string|undefined, + ifYesOutcome: string|undefined, + strokeBloodclotting: string|undefined, + ifYesstrokeBloodclotting: string|undefined, + dizzinessFetigue: string|undefined, + ifyesdizzinessFetigue: string|undefined, + antiColligent: string|undefined, + injuriesHospitalization: string|undefined, + supplementsOrDrugs: string|undefined, + )=> void + patientDataDiplay:any; + type:string; + +} + +function DataTable({handleFormSection5Data,patientDataDiplay,type}:Props) { const [illnessFromData, setIllnessFromData] = React.useState({ id:0,date:'',illness:'',treatment:'',results:'' @@ -48,14 +68,12 @@ const DataTable: React.FC= () => { results: '' }); } - }; - - console.log("sdfsdfdsf",illnessData, illnessFromData) - + }; return ( <> If yes, Please enter the details below:

+ {type!=="display"? @@ -120,6 +138,7 @@ const DataTable: React.FC= () => { + :""} @@ -149,9 +168,12 @@ const DataTable: React.FC= () => { {row.results} - + :""} ))} diff --git a/src/Components/PatientForm/PastTreatment5.tsx b/src/Components/PatientForm/PastTreatment5.tsx index 539c3d9..7ad90c8 100644 --- a/src/Components/PatientForm/PastTreatment5.tsx +++ b/src/Components/PatientForm/PastTreatment5.tsx @@ -281,7 +281,10 @@ export default function PastTreatment5({handleFormSection5Data,patientDataDiplay - +
diff --git a/src/Components/PatientForm/PatientForm.tsx b/src/Components/PatientForm/PatientForm.tsx index dd6e745..9e0c603 100644 --- a/src/Components/PatientForm/PatientForm.tsx +++ b/src/Components/PatientForm/PatientForm.tsx @@ -388,6 +388,8 @@ export default function PatientForm({type}:Props){ //@ts-ignore const patientData = localStorage.getItem('patientData') ? JSON.parse(localStorage.getItem('patientData')) : []; + + console.log("dfsdfdsf",patientData) return( <>