Doctor Patient Edit Form Update 2
This commit is contained in:
@@ -6,11 +6,16 @@ const __filename = fileURLToPath(import.meta.url);
|
|||||||
const __dirname = dirname(__filename);
|
const __dirname = dirname(__filename);
|
||||||
|
|
||||||
const compat = new FlatCompat({
|
const compat = new FlatCompat({
|
||||||
baseDirectory: __dirname,
|
baseDirectory: __dirname,
|
||||||
});
|
});
|
||||||
|
|
||||||
const eslintConfig = [
|
const eslintConfig = [
|
||||||
...compat.extends("next/core-web-vitals", "next/typescript"),
|
...compat.extends("next/core-web-vitals", "next/typescript"),
|
||||||
|
{
|
||||||
|
rules: {
|
||||||
|
'@typescript-eslint/no-explicit-any': 'off',
|
||||||
|
},
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export default eslintConfig;
|
export default eslintConfig;
|
||||||
|
|||||||
@@ -9,15 +9,10 @@ import { Input } from "@/components/ui/input"
|
|||||||
import { Label } from "@/components/ui/label"
|
import { Label } from "@/components/ui/label"
|
||||||
|
|
||||||
|
|
||||||
export function PersonForm({ person }: any) {
|
export function PersonForm({ person }: { person: { email: string, name: string, medications: any[], diagnoses: string[] } }) {
|
||||||
|
|
||||||
const [medications, setMedications] = useState(person.medications || [])
|
const [medications, setMedications] = useState(person.medications || [])
|
||||||
|
|
||||||
async function onSubmit(event: React.FormEvent<HTMLFormElement>) {
|
|
||||||
event.preventDefault()
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
const [diagnoses, setDiagnoses] = useState(person.diagnoses || [])
|
const [diagnoses, setDiagnoses] = useState(person.diagnoses || [])
|
||||||
|
|
||||||
const handleDiagnosesChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
const handleDiagnosesChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
@@ -58,7 +53,7 @@ export function PersonForm({ person }: any) {
|
|||||||
<div className="mb-4">
|
<div className="mb-4">
|
||||||
<Label>Medications:</Label>
|
<Label>Medications:</Label>
|
||||||
<br />
|
<br />
|
||||||
{medications.map((medication: any, index: number) => (
|
{medications.map((medication: { name: string, dosage: string, frequency:string }, index: number) => (
|
||||||
<div key={index} className="mb-2 grid grid-cols-3 gap-2">
|
<div key={index} className="mb-2 grid grid-cols-3 gap-2">
|
||||||
<Input
|
<Input
|
||||||
type="text"
|
type="text"
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { Label } from '@/components/ui/label';
|
|||||||
import { Card, CardHeader, CardContent } from '@/components/ui/card';
|
import { Card, CardHeader, CardContent } from '@/components/ui/card';
|
||||||
|
|
||||||
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible"
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible"
|
||||||
import { ChevronDown, ChevronUp } from "lucide-react"
|
import { ChevronDown } from "lucide-react"
|
||||||
|
|
||||||
import { PersonForm } from './PatientForm';
|
import { PersonForm } from './PatientForm';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user