-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
712a588
commit 5b55f44
Showing
15 changed files
with
446 additions
and
425 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,44 @@ | ||
import { Patient } from "aidbox-sdk/types"; | ||
import { useEffect, useState } from "react"; | ||
import { Client } from 'aidbox-sdk' | ||
import { Patient } from 'aidbox-sdk/types' | ||
import { useEffect, useState } from 'react' | ||
|
||
import { PatientInfo } from "./components/patient-info"; | ||
import { Workspace } from "./components/workspace"; | ||
import { Client } from "aidbox-sdk"; | ||
import { ClientContext } from "./context"; | ||
import { PatientInfo } from './components/patient-info' | ||
import { Workspace } from './components/workspace' | ||
import { ClientContext } from './context' | ||
|
||
export function App({ client }: { client: Client }) { | ||
const [patient, setPatient] = useState<Patient>({}); | ||
import './index.css' | ||
|
||
const searchParams = new URLSearchParams(document.location.search); | ||
export function App ({ client }: { client: Client }) { | ||
const [patient, setPatient] = useState<Patient>({}) | ||
|
||
const searchParams = new URLSearchParams(document.location.search) | ||
const patient_id = | ||
searchParams.get("id") || "fd22f7f8-70a6-4d45-b818-8be4eb2ed0ea"; | ||
searchParams.get('id') || 'fd22f7f8-70a6-4d45-b818-8be4eb2ed0ea' | ||
|
||
useEffect(() => { | ||
if (patient_id) { | ||
client.getResource("Patient", patient_id).then((response) => { | ||
client.getResource('Patient', patient_id).then((response) => { | ||
if (response?.id) { | ||
setPatient(response); | ||
setPatient(response) | ||
} | ||
}); | ||
}) | ||
} | ||
}, [patient_id]); | ||
}, [patient_id]) | ||
|
||
return ( | ||
<ClientContext.Provider value={{ client }}> | ||
<div style={{ display: "flex", flexDirection: "row" }}> | ||
<div style={{ display: 'flex', flexDirection: 'row' }}> | ||
<PatientInfo patient={patient} /> | ||
<div | ||
style={{ | ||
padding: "2rem 0", | ||
background: "#FAFBFD", | ||
width: "calc(100% - 300px)", | ||
padding: '2rem 0', | ||
background: '#FAFBFD', | ||
width: 'calc(100% - 300px)' | ||
}} | ||
> | ||
<Workspace patient={patient} /> | ||
</div> | ||
</div> | ||
</ClientContext.Provider> | ||
); | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.