Update separated pharmacokinetic from diagram settings, made both collapsible
This commit is contained in:
@@ -18,6 +18,7 @@ import { Label } from './ui/label';
|
|||||||
import { Separator } from './ui/separator';
|
import { Separator } from './ui/separator';
|
||||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './ui/select';
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './ui/select';
|
||||||
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './ui/tooltip';
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './ui/tooltip';
|
||||||
|
import { ChevronDown, ChevronUp } from 'lucide-react';
|
||||||
|
|
||||||
const Settings = ({
|
const Settings = ({
|
||||||
pkParams,
|
pkParams,
|
||||||
@@ -32,11 +33,20 @@ const Settings = ({
|
|||||||
const { showDayTimeOnXAxis, yAxisMin, yAxisMax, showTemplateDay, simulationDays, displayedDays } = uiSettings;
|
const { showDayTimeOnXAxis, yAxisMin, yAxisMax, showTemplateDay, simulationDays, displayedDays } = uiSettings;
|
||||||
const showDayReferenceLines = (uiSettings as any).showDayReferenceLines ?? true;
|
const showDayReferenceLines = (uiSettings as any).showDayReferenceLines ?? true;
|
||||||
|
|
||||||
|
const [isDiagramExpanded, setIsDiagramExpanded] = React.useState(true);
|
||||||
|
const [isPharmacokineticExpanded, setIsPharmacokineticExpanded] = React.useState(true);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<div className="space-y-4">
|
||||||
|
{/* Diagram Settings Card */}
|
||||||
<Card>
|
<Card>
|
||||||
<CardHeader>
|
<CardHeader className="cursor-pointer pb-3" onClick={() => setIsDiagramExpanded(!isDiagramExpanded)}>
|
||||||
|
<div className="flex items-center justify-between">
|
||||||
<CardTitle className="text-lg">{t('diagramSettings')}</CardTitle>
|
<CardTitle className="text-lg">{t('diagramSettings')}</CardTitle>
|
||||||
|
{isDiagramExpanded ? <ChevronUp className="h-5 w-5" /> : <ChevronDown className="h-5 w-5" />}
|
||||||
|
</div>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
|
{isDiagramExpanded && (
|
||||||
<CardContent className="space-y-4">
|
<CardContent className="space-y-4">
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<Label className="font-medium">{t('xAxisTimeFormat')}</Label>
|
<Label className="font-medium">{t('xAxisTimeFormat')}</Label>
|
||||||
@@ -150,7 +160,7 @@ const Settings = ({
|
|||||||
<FormNumericInput
|
<FormNumericInput
|
||||||
value={yAxisMax}
|
value={yAxisMax}
|
||||||
onChange={val => onUpdateUiSetting('yAxisMax', val)}
|
onChange={val => onUpdateUiSetting('yAxisMax', val)}
|
||||||
increment={5}
|
increment={1}
|
||||||
min={0}
|
min={0}
|
||||||
placeholder={t('auto')}
|
placeholder={t('auto')}
|
||||||
unit="ng/ml"
|
unit="ng/ml"
|
||||||
@@ -185,9 +195,20 @@ const Settings = ({
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</CardContent>
|
||||||
|
)}
|
||||||
|
</Card>
|
||||||
|
|
||||||
<Separator className="my-4" />
|
{/* Pharmacokinetic Settings Card */}
|
||||||
|
<Card>
|
||||||
|
<CardHeader className="cursor-pointer pb-3" onClick={() => setIsPharmacokineticExpanded(!isPharmacokineticExpanded)}>
|
||||||
|
<div className="flex items-center justify-between">
|
||||||
|
<CardTitle className="text-lg">{t('pharmacokineticsSettings')}</CardTitle>
|
||||||
|
{isPharmacokineticExpanded ? <ChevronUp className="h-5 w-5" /> : <ChevronDown className="h-5 w-5" />}
|
||||||
|
</div>
|
||||||
|
</CardHeader>
|
||||||
|
{isPharmacokineticExpanded && (
|
||||||
|
<CardContent className="space-y-4">
|
||||||
<h3 className="text-lg font-semibold">{t('dAmphetamineParameters')}</h3>
|
<h3 className="text-lg font-semibold">{t('dAmphetamineParameters')}</h3>
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<Label className="font-medium">{t('halfLife')}</Label>
|
<Label className="font-medium">{t('halfLife')}</Label>
|
||||||
@@ -230,9 +251,11 @@ const Settings = ({
|
|||||||
errorMessage={t('absorptionRateRequired') || 'Absorption rate is required'}
|
errorMessage={t('absorptionRateRequired') || 'Absorption rate is required'}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
</CardContent>
|
||||||
|
)}
|
||||||
|
</Card>
|
||||||
|
|
||||||
<Separator className="my-4" />
|
{/* Reset Button - Always Visible */}
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={onReset}
|
onClick={onReset}
|
||||||
@@ -241,8 +264,7 @@ const Settings = ({
|
|||||||
>
|
>
|
||||||
{t('resetAllSettings')}
|
{t('resetAllSettings')}
|
||||||
</Button>
|
</Button>
|
||||||
</CardContent>
|
</div>
|
||||||
</Card>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -105,6 +105,6 @@ export const getDefaultState = (): AppState => ({
|
|||||||
yAxisMin: '8',
|
yAxisMin: '8',
|
||||||
yAxisMax: '13',
|
yAxisMax: '13',
|
||||||
simulationDays: '5',
|
simulationDays: '5',
|
||||||
displayedDays: '5',
|
displayedDays: '2',
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ export const de = {
|
|||||||
|
|
||||||
// Settings
|
// Settings
|
||||||
diagramSettings: "Diagramm-Einstellungen",
|
diagramSettings: "Diagramm-Einstellungen",
|
||||||
|
pharmacokineticsSettings: "Pharmakokinetik-Einstellungen",
|
||||||
xAxisTimeFormat: "Zeitformat",
|
xAxisTimeFormat: "Zeitformat",
|
||||||
xAxisFormatContinuous: "Fortlaufend",
|
xAxisFormatContinuous: "Fortlaufend",
|
||||||
xAxisFormatContinuousDesc: "Endlose Sequenz (0h, 6h, 12h...)",
|
xAxisFormatContinuousDesc: "Endlose Sequenz (0h, 6h, 12h...)",
|
||||||
@@ -77,8 +78,9 @@ export const de = {
|
|||||||
conversionHalfLife: "Umwandlungs-Halbwertszeit",
|
conversionHalfLife: "Umwandlungs-Halbwertszeit",
|
||||||
absorptionRate: "Absorptionsrate",
|
absorptionRate: "Absorptionsrate",
|
||||||
faster: "(schneller >)",
|
faster: "(schneller >)",
|
||||||
resetAllSettings: "Alle Einstellungen zurücksetzen",
|
resetAllSettings: "Alle Einstellungen zurücksetzen", resetDiagramSettings: "Diagramm-Einstellungen zurücksetzen",
|
||||||
|
resetPharmacokineticSetting: "Pharmakokinetik-Einstellungen zurücksetzen",
|
||||||
|
resetPlan: "Plan zurücksetzen",
|
||||||
// Units
|
// Units
|
||||||
unitMg: "mg",
|
unitMg: "mg",
|
||||||
unitNgml: "ng/ml",
|
unitNgml: "ng/ml",
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ export const en = {
|
|||||||
|
|
||||||
// Settings
|
// Settings
|
||||||
diagramSettings: "Diagram Settings",
|
diagramSettings: "Diagram Settings",
|
||||||
|
pharmacokineticsSettings: "Pharmacokinetics Settings",
|
||||||
xAxisTimeFormat: "Time Format",
|
xAxisTimeFormat: "Time Format",
|
||||||
xAxisFormatContinuous: "Continuous",
|
xAxisFormatContinuous: "Continuous",
|
||||||
xAxisFormatContinuousDesc: "Endless sequence (0h, 6h, 12h...)",
|
xAxisFormatContinuousDesc: "Endless sequence (0h, 6h, 12h...)",
|
||||||
@@ -76,8 +77,9 @@ export const en = {
|
|||||||
conversionHalfLife: "Conversion Half-life",
|
conversionHalfLife: "Conversion Half-life",
|
||||||
absorptionRate: "Absorption Rate",
|
absorptionRate: "Absorption Rate",
|
||||||
faster: "(faster >)",
|
faster: "(faster >)",
|
||||||
resetAllSettings: "Reset All Settings",
|
resetAllSettings: "Reset All Settings", resetDiagramSettings: "Reset Diagram Settings",
|
||||||
|
resetPharmacokineticSettings: "Reset Pharmacokinetic Settings",
|
||||||
|
resetPlan: "Reset Plan",
|
||||||
// Units
|
// Units
|
||||||
unitMg: "mg",
|
unitMg: "mg",
|
||||||
unitNgml: "ng/ml",
|
unitNgml: "ng/ml",
|
||||||
|
|||||||
Reference in New Issue
Block a user