dawit45 commited on
Commit
f66b1d8
·
verified ·
1 Parent(s): 44298a6

Update src/App.tsx

Browse files
Files changed (1) hide show
  1. src/App.tsx +11 -22
src/App.tsx CHANGED
@@ -1,37 +1,26 @@
1
- import React, { useEffect } from '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
- useEffect(() => {
11
- // Initial fetch to populate matches
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 h-screen bg-[#f9fafb]">
23
  <Sidebar />
24
- <main className="flex-1 overflow-y-auto p-8">
25
  <header className="mb-8">
26
- <h1 className="text-2xl font-semibold text-gray-900">Clinical Dashboard</h1>
27
- <p className="text-gray-500">Patient Profile: {mutation} {cancerType}</p>
28
  </header>
29
 
30
- <div className="grid grid-cols-1 gap-6 max-w-4xl">
31
- <h2 className="text-sm font-bold text-gray-400 uppercase tracking-widest">Trial Matches</h2>
32
  {matches.map((trial: TrialMatch) => (
33
- <TrialResultCard key={trial.nct_id} trial={trial} />
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 />