Update style improvements and minor fixes

This commit is contained in:
2025-11-29 18:45:30 +00:00
parent 19770a2a3c
commit 5865d9dbe5
7 changed files with 162 additions and 86 deletions

View File

@@ -22,13 +22,19 @@ interface SuggestionResult {
dayOffset?: number;
}
interface Translations {
noSuitableNextDose: string;
noSignificantCorrection: string;
}
export const generateSuggestion = (
doses: Dose[],
deviations: Deviation[],
doseIncrement: string,
simulationDays: string,
steadyStateConfig: SteadyStateConfig,
pkParams: PkParams
pkParams: PkParams,
t: Translations
): SuggestionResult | null => {
if (deviations.length === 0) {
return null;
@@ -68,7 +74,7 @@ export const generateSuggestion = (
});
if (!nextDose) {
return { text: "Keine passende nächste Dosis für Korrektur gefunden." };
return { text: t.noSuitableNextDose };
}
// Type assertion after null check
@@ -85,7 +91,7 @@ export const generateSuggestion = (
const concentrationDifference = idealConcentration - deviatedConcentration;
if (Math.abs(concentrationDifference) < 0.5) {
return { text: "Keine signifikante Korrektur notwendig." };
return { text: t.noSignificantCorrection };
}
const doseAdjustmentFactor = 0.5;