Update style improvements and minor fixes
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user