// ABOUTME: Exercise plan reference page. // ABOUTME: Displays the full monthly exercise plan by phase with current phase highlighted. "use client"; import { useCallback, useEffect, useState } from "react"; import type { CyclePhase, PhaseConfig } from "@/types"; interface CycleData { cycleDay: number; phase: CyclePhase; phaseConfig: PhaseConfig; daysUntilNextPhase: number; cycleLength: number; } // Phase configurations for display const PHASES: Array<{ name: CyclePhase; displayName: string; weeklyLimit: number; trainingType: string; description: string; }> = [ { name: "MENSTRUAL", displayName: "Menstrual", weeklyLimit: 30, trainingType: "Gentle rebounding only", description: "Focus on rest and gentle movement. Light lymphatic drainage.", }, { name: "FOLLICULAR", displayName: "Follicular", weeklyLimit: 120, trainingType: "Strength + rebounding", description: "Building phase - increase intensity and add strength training.", }, { name: "OVULATION", displayName: "Ovulation", weeklyLimit: 80, trainingType: "Peak performance", description: "Peak energy - maximize intensity and plyometric movements.", }, { name: "EARLY_LUTEAL", displayName: "Early Luteal", weeklyLimit: 100, trainingType: "Moderate training", description: "Maintain intensity but listen to your body for signs of fatigue.", }, { name: "LATE_LUTEAL", displayName: "Late Luteal", weeklyLimit: 50, trainingType: "Gentle rebounding ONLY", description: "Wind down phase - focus on stress relief and gentle movement.", }, ]; const STRENGTH_EXERCISES = [ { name: "Squats", sets: "3x8-12" }, { name: "Push-ups", sets: "3x5-10" }, { name: "Single-leg Deadlifts", sets: "3x6-8 each" }, { name: "Plank", sets: "3x20-45s" }, { name: "Kettlebell Swings", sets: "2x10-15" }, ]; const REBOUNDING_TECHNIQUES = [ { phase: "Menstrual", techniques: "Health bounce, lymphatic drainage", }, { phase: "Follicular", techniques: "Strength bounce, intervals", }, { phase: "Ovulation", techniques: "Maximum intensity, plyometric", }, { phase: "Luteal", techniques: "Therapeutic, stress relief", }, ]; export default function PlanPage() { const [cycleData, setCycleData] = useState(null); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); const fetchCycleData = useCallback(async () => { const response = await fetch("/api/cycle/current"); const data = await response.json(); if (!response.ok) { throw new Error(data.error || "Failed to fetch cycle data"); } return data as CycleData; }, []); useEffect(() => { async function loadData() { try { setLoading(true); setError(null); const data = await fetchCycleData(); setCycleData(data); } catch (err) { setError(err instanceof Error ? err.message : "An error occurred"); } finally { setLoading(false); } } loadData(); }, [fetchCycleData]); if (loading) { return (

Exercise Plan

Loading...

); } if (error) { return (

Exercise Plan

Error: {error}
); } return (

Exercise Plan

{cycleData && (
{/* Current Phase Status */}

Current Status

Day {cycleData.cycleDay} · {cycleData.phase.replace("_", " ")}

{cycleData.daysUntilNextPhase} days until next phase

Training type:{" "} {cycleData.phaseConfig.trainingType}

Weekly limit:{" "} {cycleData.phaseConfig.weeklyLimit} min/week

{/* Phase Overview */}

Phase Overview

{PHASES.map((phase) => (

{phase.displayName}

{phase.trainingType}

{phase.weeklyLimit} min/week

{phase.description}

))}
{/* Strength Training Reference */}

Strength Training (Follicular Phase)

Mon/Wed/Fri during follicular phase (20-25 min per session)

{STRENGTH_EXERCISES.map((exercise) => ( ))}
Exercise Sets × Reps
{exercise.name} {exercise.sets}
{/* Rebounding Techniques */}

Rebounding Techniques

Adjust your rebounding style based on your current phase

{REBOUNDING_TECHNIQUES.map((item) => (

{item.phase}

{item.techniques}

))}
{/* Weekly Schedule Reference */}

Weekly Guidelines

Menstrual Phase (Days 1-3)

  • Morning: 10-15 min gentle rebounding
  • Evening: 15-20 min restorative movement
  • No strength training

Follicular Phase (Days 4-14)

  • Mon/Wed/Fri: Strength training (20-25 min)
  • Tue/Thu: Active recovery rebounding (20 min)
  • Weekend: Choose your adventure

Ovulation + Early Luteal (Days 15-24)

  • Days 15-16: Peak performance (25-30 min strength)
  • Days 17-21: Modified strength (reduce intensity 10-20%)

Late Luteal Phase (Days 22-28)

  • Daily: Gentle rebounding only (15-20 min)
  • Optional light bodyweight Mon/Wed if feeling good
  • Rest days: Tue/Thu/Sat/Sun
)}
); }