diff --git a/src/app/growth/page.tsx b/src/app/growth/page.tsx index 3680bf6..3e7d581 100644 --- a/src/app/growth/page.tsx +++ b/src/app/growth/page.tsx @@ -510,7 +510,30 @@ export default function GrowthPage() { - {/* WHO Standards Content - Collapsible */} + {/* When collapsed - Show recommended values with icons */} + {!showWhoStandards && ( +
+
+
standard.weight.p85 ? "bg-amber-100 dark:bg-amber-900" : "bg-green-50 dark:bg-green-900"}`}> +
⚖️
+
{standard.weight.p50} kg
+
{standard.weight.p3}-{standard.weight.p97}
+
+
standard.height.p85 ? "bg-amber-100 dark:bg-amber-900" : "bg-green-50 dark:bg-green-900"}`}> +
📏
+
{standard.height.p50} cm
+
{standard.height.p3}-{standard.height.p97}
+
+
standard.headCircumference.p85 ? "bg-amber-100 dark:bg-amber-900" : "bg-green-50 dark:bg-green-900"}`}> +
+
{standard.headCircumference.p50} cm
+
{standard.headCircumference.p3}-{standard.headCircumference.p97}
+
+
+
+ )} + + {/* When expanded - Show full details + chart */} {showWhoStandards && (
{/* Color-coded percentile zones legend */} @@ -573,33 +596,17 @@ export default function GrowthPage() {
)} - {/* Growth Chart - Inside collapsible card */} + {/* Growth Chart - Collapsible inside expanded view */} {chartData && growthData.length > 0 && (
-
-

Growth Chart

-
- - - -
-
- + + {showChart && }
)} @@ -685,51 +692,55 @@ export default function GrowthPage() { ) : ( - /* History List */ -
-

History

- {growthData.map((record: any, i: number) => ( -
-
-
- {new Date(record.measured_at).toLocaleDateString()} + /* History List - Collapsible */ +
+ + {showHistory && ( +
+ {growthData.map((record, i) => ( +
+
+
+ {new Date(record.measured_at).toLocaleDateString()} ({child ? formatAge(child.birthDate, record.measured_at) : ""}) +
+
+ {record.weight_kg && ( + ⚖️ {record.weight_kg}kg + )} + {record.height_cm && ( + 📏 {record.height_cm}cm + )} + {record.head_circumference_cm && ( + ⭕ {record.head_circumference_cm}cm + )} +
+
+
+ + +
-
- {record.weight_kg && ( -
- ⚖️ {record.weight_kg} kg -
- )} - {record.height_cm && ( -
- 📏 {record.height_cm} cm -
- )} - {record.head_circumference_cm && ( -
- ⭕ {record.head_circumference_cm} cm -
- )} -
-
-
- - -
+ ))}
- ))} + )}
)}