Update src/App.tsx
Browse files- src/App.tsx +11 -22
src/App.tsx
CHANGED
|
@@ -1,37 +1,26 @@
|
|
| 1 |
-
import React
|
|
|
|
| 2 |
import { useOncologyStore, type TrialMatch } from './store/useOncologyStore';
|
| 3 |
import Sidebar from './components/Sidebar';
|
| 4 |
import TrialResultCard from './components/TrialResultCard';
|
| 5 |
import ToxicityAlertRail from './components/ToxicityAlertRail';
|
| 6 |
-
import { TrialMatch } from './store/useOncologyStore';
|
| 7 |
-
const App = () => {
|
| 8 |
-
const { mutation, cancerType, matches, setMatches } = useOncologyStore();
|
| 9 |
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
fetch('/api/v13/comprehensive-profile', {
|
| 13 |
-
method: 'POST',
|
| 14 |
-
headers: { 'Content-Type': 'application/json' },
|
| 15 |
-
body: JSON.stringify({ mutation, cancer_type: cancerType })
|
| 16 |
-
})
|
| 17 |
-
.then(res => res.json())
|
| 18 |
-
.then(data => setMatches(data.trial_matches));
|
| 19 |
-
}, [mutation, cancerType]);
|
| 20 |
|
| 21 |
return (
|
| 22 |
-
<div className="flex
|
| 23 |
<Sidebar />
|
| 24 |
-
<main className="flex-1
|
| 25 |
<header className="mb-8">
|
| 26 |
-
<h1 className="text-2xl font-
|
| 27 |
-
<p className="text-gray-500">Patient Profile: {mutation}
|
| 28 |
</header>
|
| 29 |
|
| 30 |
-
<div className="grid grid-cols-1 gap-6
|
| 31 |
-
<h2 className="text-sm font-bold text-gray-400 uppercase tracking-widest">Trial Matches</h2>
|
| 32 |
{matches.map((trial: TrialMatch) => (
|
| 33 |
-
|
| 34 |
-
))}
|
| 35 |
</div>
|
| 36 |
</main>
|
| 37 |
<ToxicityAlertRail />
|
|
|
|
| 1 |
+
import React from 'react';
|
| 2 |
+
// Import the shared interface from the store
|
| 3 |
import { useOncologyStore, type TrialMatch } from './store/useOncologyStore';
|
| 4 |
import Sidebar from './components/Sidebar';
|
| 5 |
import TrialResultCard from './components/TrialResultCard';
|
| 6 |
import ToxicityAlertRail from './components/ToxicityAlertRail';
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
+
const App = () => {
|
| 9 |
+
const { matches, mutation, cancerType } = useOncologyStore();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
return (
|
| 12 |
+
<div className="flex bg-gray-50 min-h-screen">
|
| 13 |
<Sidebar />
|
| 14 |
+
<main className="flex-1 p-8">
|
| 15 |
<header className="mb-8">
|
| 16 |
+
<h1 className="text-2xl font-bold text-gray-900">Clinical Dashboard</h1>
|
| 17 |
+
<p className="text-gray-500">Patient Profile: {mutation} | {cancerType}</p>
|
| 18 |
</header>
|
| 19 |
|
| 20 |
+
<div className="grid grid-cols-1 gap-6">
|
|
|
|
| 21 |
{matches.map((trial: TrialMatch) => (
|
| 22 |
+
<TrialResultCard key={trial.nct_id} trial={trial} />
|
| 23 |
+
))}
|
| 24 |
</div>
|
| 25 |
</main>
|
| 26 |
<ToxicityAlertRail />
|