fix doc weight to show real doc instead of forcing 35-51 range and also fixed bug target weight using total days as reference for target weight instead of doc weight

This commit is contained in:
Alberto-Audrix committed 2026-09-07 10:43:54 +07:00
1 parent 4439e3b7b1
commit 75eb218558
8 files changed
+76 -34

No files matched your search

+3 -3
View File
@@ -35,11 +35,11 @@ const StatItem: React.FC<{
interface WeightStatsProps {
latest: LatestAvg | null;
totalDays: number;
docWeight: number;
}
const WeightStats: React.FC<WeightStatsProps> = ({ latest, totalDays }) => {
const target = latest ? getTargetWeightForAge(latest.age, totalDays) : null;
const WeightStats: React.FC<WeightStatsProps> = ({ latest, docWeight }) => {
const target = latest ? getTargetWeightForAge(latest.age, docWeight) : null;
return (
<div className="bg-white p-6 rounded-xl shadow-sm h-full">