patient update 4
This commit is contained in:
@@ -3,7 +3,6 @@ import { useState, useEffect } from 'react';
|
||||
import axios from 'axios';
|
||||
import { useUser } from '@clerk/nextjs';
|
||||
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import { Card, CardHeader, CardContent } from '@/components/ui/card';
|
||||
|
||||
@@ -21,21 +20,7 @@ const AccountPage = () => {
|
||||
|
||||
if (!userData) return <div>Loading...</div>;
|
||||
|
||||
const [medications, setMedications] = useState([]);
|
||||
const handleMedicationsChange = (index, field, value) => {
|
||||
const newMedications = [...medications];
|
||||
newMedications[index][field] = value;
|
||||
setMedications(newMedications);
|
||||
}
|
||||
|
||||
const handleAddMedication = () => {
|
||||
setMedications([...medications, { name: '', dosage: '', frequency: '' }]);
|
||||
}
|
||||
|
||||
const [diagnoses, setDiagnoses] = useState([]);
|
||||
const handleDiagnosesChange = (e) => {
|
||||
setDiagnoses(e.target.value.split(','));
|
||||
}
|
||||
console.log(userData);
|
||||
|
||||
return (
|
||||
<div className="container mx-auto p-4">
|
||||
@@ -56,61 +41,6 @@ const AccountPage = () => {
|
||||
<Label>Role:</Label>
|
||||
<p>{userData.role}</p>
|
||||
</div>
|
||||
<div className="mb-4">
|
||||
<Label>Medications:</Label>
|
||||
<br/>
|
||||
{medications.map((medication, index) => (
|
||||
<div key={index} className="mb-2 grid grid-cols-3 gap-2">
|
||||
<Input
|
||||
type="text"
|
||||
placeholder="Name"
|
||||
value={medication.name}
|
||||
onChange={(e) => handleMedicationsChange(index, 'name', e.target.value)}
|
||||
className="mb-2"
|
||||
/>
|
||||
<Input
|
||||
type="text"
|
||||
placeholder="Dosage"
|
||||
value={medication.dosage}
|
||||
onChange={(e) => handleMedicationsChange(index, 'dosage', e.target.value)}
|
||||
className="mb-2"
|
||||
/>
|
||||
<Input
|
||||
type="text"
|
||||
placeholder="Frequency"
|
||||
value={medication.frequency}
|
||||
onChange={(e) => handleMedicationsChange(index, 'frequency', e.target.value)}
|
||||
className="mb-2"
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
<div className="mb-2 grid grid-cols-4 gap-2">
|
||||
<Input
|
||||
type="text"
|
||||
placeholder="Name"
|
||||
className="mb-2"
|
||||
/>
|
||||
<Input
|
||||
type="text"
|
||||
placeholder="Dosage"
|
||||
className="mb-2"
|
||||
/>
|
||||
<Input
|
||||
type="text"
|
||||
placeholder="Frequency"
|
||||
className="mb-2"
|
||||
/>
|
||||
<Button onClick={handleAddMedication}>Add Medication</Button>
|
||||
</div>
|
||||
</div>
|
||||
<div className="mb-4">
|
||||
<Label>Diagnoses:</Label>
|
||||
<Input
|
||||
type="text"
|
||||
value={diagnoses.join(',')}
|
||||
onChange={handleDiagnosesChange}
|
||||
/>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
@@ -22,6 +22,6 @@
|
||||
"@/*": ["./src/*"]
|
||||
}
|
||||
},
|
||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "src/app/api/connectDB.js", "src/lib/utils.js", "src/app/(web)/account/page.jsx"],
|
||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "src/app/api/connectDB.js", "src/lib/utils.js", "src/app/(web)/account/page.jsx", "src/app/(panels)/suite/patient/account/page.jsx"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user