"use client";
import { useState } from "react";
import { motion, AnimatePresence } from "framer-motion";
import { LineChart, Line, XAxis, Tooltip, ResponsiveContainer } from "recharts";
import { useGUCStore } from "@/lib/store";
import MoodCheckIn from "@/components/MoodCheckIn";
import BreathingWidget from "@/components/BreathingWidget";
import { PageShell } from "@/components/ui";
const AFFIRMATIONS = {
high_stress: [
"You came to the right place. Take 5 slow breaths right now. 💙",
"Recovery is not a straight line. Every small step counts.",
"Dr. Raahat believes in you. One breath at a time.",
],
normal: [
"You're making progress every single day. 🌱",
"Consistency beats intensity. You're building healthy habits.",
"Your body is doing its best. Support it with rest and good food.",
],
great: [
"You're thriving! Keep this momentum. 🌟",
"High energy day — channel it into your health goals!",
"This is what healing looks like. Celebrate the small wins.",
],
};
function getAffirmation(stress: number, sleep: number): string {
const pool =
stress <= 3 ? AFFIRMATIONS.high_stress
: stress >= 8 && sleep >= 7 ? AFFIRMATIONS.great
: AFFIRMATIONS.normal;
return pool[Math.floor(Math.random() * pool.length)];
}
const MoodTooltip = ({ active, payload }: any) => {
if (!active || !payload?.length) return null;
return (
🩺 Your recent report showed{" "}
{latestReport.severity_level.replace("_", " ").toLowerCase()}
. Medical stress is real. Talking to Dr. Raahat in the chat can help reduce anxiety about your results.
)}
{/* Tabs — animated sliding indicator */}
{TABS.map((tab) => (
))}
{/* Tab content */}
{activeTab === "mood" && (
Why Sleep Matters for Recovery
{[
{ icon: "🩸", text: "Iron is absorbed better when you sleep 7+ hours" },
{ icon: "🦴", text: "Bone repair and Vitamin D activation happen during deep sleep" },
{ icon: "🛡️", text: "Immune system strengthens during sleep cycles" },
{ icon: "🧠", text: "Stress hormones drop by 30% after a full night of sleep" },
].map((tip, i) => (