diff --git a/src/app/growth/page.tsx b/src/app/growth/page.tsx index 72da19d..43f18e6 100644 --- a/src/app/growth/page.tsx +++ b/src/app/growth/page.tsx @@ -1,6 +1,7 @@ "use client"; import { useState, useEffect } from "react"; +import Link from "next/link"; import { useFamily } from "../FamilyProvider"; import { Button, Card, Input, ConfirmDialog } from "@/components/ui"; import { WHO_BOY_WEIGHT, WHO_GIRL_WEIGHT, getAgeInMonthsFromBirth, getPercentile } from "@/lib/growth-standards"; @@ -337,15 +338,38 @@ export default function GrowthPage() { return (
-
-
- -

Growth 📈

+ {/* Header */} +
+
+ ← +

Growth 📈

-
- - - + +
@@ -353,28 +377,55 @@ export default function GrowthPage() { {/* Goals Card */} {showGoals && ( - -

Set Growth Goals

-
- setGoal({ ...goal, weightKg: parseFloat(e.target.value) || undefined })} - /> - setGoal({ ...goal, heightCm: parseFloat(e.target.value) || undefined })} - /> -
- - -
+
+

🎯 Growth Goals

+ setGoal({ ...goal, weightKg: parseFloat(e.target.value) || undefined })} + /> + setGoal({ ...goal, heightCm: parseFloat(e.target.value) || undefined })} + /> +
+ +
- +
+ )} + + {/* Add / Edit Measurement — always at the top, right below the header */} + {showAdd && ( +
+

{editingId ? "✏️ Edit Record" : "📏 New Measurement"}

+ {saveError && ( +
{saveError}
+ )} + setMeasuredAt(e.target.value)} /> +
+ setWeight(e.target.value)} /> + setHeight(e.target.value)} /> + setHeadCircumference(e.target.value)} /> +
+
+ {editingId ? ( + <> + + + + ) : ( + <> + + + + )} +
+
)} {/* Latest Reading Card */} {latest && ( -
+
Latest Reading
@@ -438,7 +489,7 @@ export default function GrowthPage() { {/* WHO Standards + Chart Card - Collapsible */} {child && standard && ( -
+
{/* WHO Standards Header - Clickable */}
)} - {/* Add Measurement - Same pattern as Goals */} - {showAdd && latest && ( -
-

{editingId ? "Edit Record" : "Add New Measurement"}

- {saveError && ( -
{saveError}
- )} - setMeasuredAt(e.target.value)} /> - setWeight(e.target.value)} /> - setHeight(e.target.value)} /> - setHeadCircumference(e.target.value)} /> -
- {editingId ? ( - <> - - - - ) : ( - <> - - - - )} -
-
- )} {/* Empty State */} {loading ? ( @@ -593,19 +618,19 @@ export default function GrowthPage() {

Loading...

) : growthData.length === 0 ? ( - -
-
📏
-

Track {child?.name}'s Growth

-

- Start logging weight, height, and head measurements to see how {child?.name} is growing compared to WHO standards. -

- -
-
+
+
📏
+

Track {child?.name}'s Growth

+

+ Log weight, height, and head measurements to see how {child?.name} compares to WHO standards. +

+ +
) : ( /* History List - Collapsible */ -
+