Update new unified dose management, style/other improvements
This commit is contained in:
59
src/App.tsx
59
src/App.tsx
@@ -12,9 +12,7 @@
|
||||
import React from 'react';
|
||||
|
||||
// Components
|
||||
import DoseSchedule from './components/dose-schedule';
|
||||
import DeviationList from './components/deviation-list';
|
||||
import SuggestionPanel from './components/suggestion-panel';
|
||||
import DaySchedule from './components/day-schedule';
|
||||
import SimulationChart from './components/simulation-chart';
|
||||
import Settings from './components/settings';
|
||||
import LanguageSelector from './components/language-selector';
|
||||
@@ -31,15 +29,19 @@ const MedPlanAssistant = () => {
|
||||
|
||||
const {
|
||||
appState,
|
||||
updateState,
|
||||
updateNestedState,
|
||||
updateUiSetting,
|
||||
handleReset
|
||||
handleReset,
|
||||
addDay,
|
||||
removeDay,
|
||||
addDoseToDay,
|
||||
removeDoseFromDay,
|
||||
updateDoseInDay
|
||||
} = useAppState();
|
||||
|
||||
const {
|
||||
pkParams,
|
||||
doses,
|
||||
days,
|
||||
therapeuticRange,
|
||||
doseIncrement,
|
||||
uiSettings
|
||||
@@ -50,21 +52,15 @@ const MedPlanAssistant = () => {
|
||||
chartView,
|
||||
yAxisMin,
|
||||
yAxisMax,
|
||||
showTemplateDay,
|
||||
simulationDays,
|
||||
displayedDays
|
||||
} = uiSettings;
|
||||
|
||||
const {
|
||||
deviations,
|
||||
suggestion,
|
||||
idealProfile,
|
||||
deviatedProfile,
|
||||
correctedProfile,
|
||||
addDeviation,
|
||||
removeDeviation,
|
||||
handleDeviationChange,
|
||||
applySuggestion
|
||||
} = useSimulation(appState, t);
|
||||
combinedProfile,
|
||||
templateProfile
|
||||
} = useSimulation(appState);
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-background p-4 sm:p-6 lg:p-8">
|
||||
@@ -105,9 +101,8 @@ const MedPlanAssistant = () => {
|
||||
</div>
|
||||
|
||||
<SimulationChart
|
||||
idealProfile={idealProfile}
|
||||
deviatedProfile={deviatedProfile}
|
||||
correctedProfile={correctedProfile}
|
||||
combinedProfile={combinedProfile}
|
||||
templateProfile={showTemplateDay ? templateProfile : null}
|
||||
chartView={chartView}
|
||||
showDayTimeOnXAxis={showDayTimeOnXAxis}
|
||||
therapeuticRange={therapeuticRange}
|
||||
@@ -121,26 +116,14 @@ const MedPlanAssistant = () => {
|
||||
|
||||
{/* Left Column - Controls */}
|
||||
<div className="xl:col-span-1 space-y-6">
|
||||
<DoseSchedule
|
||||
doses={doses}
|
||||
<DaySchedule
|
||||
days={days}
|
||||
doseIncrement={doseIncrement}
|
||||
onUpdateDoses={(newDoses: any) => updateState('doses', newDoses)}
|
||||
t={t}
|
||||
/>
|
||||
|
||||
<DeviationList
|
||||
deviations={deviations}
|
||||
doseIncrement={doseIncrement}
|
||||
simulationDays={simulationDays}
|
||||
onAddDeviation={addDeviation}
|
||||
onRemoveDeviation={removeDeviation}
|
||||
onDeviationChange={handleDeviationChange}
|
||||
t={t}
|
||||
/>
|
||||
|
||||
<SuggestionPanel
|
||||
suggestion={suggestion}
|
||||
onApplySuggestion={applySuggestion}
|
||||
onAddDay={addDay}
|
||||
onRemoveDay={removeDay}
|
||||
onAddDose={addDoseToDay}
|
||||
onRemoveDose={removeDoseFromDay}
|
||||
onUpdateDose={updateDoseInDay}
|
||||
t={t}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user