@@ -10,12 +10,19 @@ import {
1010 updateMesocycle ,
1111} from '../../hooks/useDatabase' ;
1212import type { Mesocycle } from '../../types/models' ;
13+ import type { Page } from '../../layouts/Layout' ;
1314import MesocycleCard from './MesocycleCard' ;
1415import MesocycleForm from './MesocycleForm' ;
1516import SplitProgressTracker from './SplitProgressTracker' ;
1617import './MesocycleDashboard.css' ;
1718
18- export default function MesocycleDashboard ( ) {
19+ interface MesocycleDashboardProps {
20+ onNavigate ?: ( page : Page ) => void ;
21+ }
22+
23+ export default function MesocycleDashboard ( {
24+ onNavigate,
25+ } : MesocycleDashboardProps ) {
1926 const allMesocycles = useMesocycles ( ) ;
2027 const activeMesocycle = useActiveMesocycle ( ) ;
2128 const [ showForm , setShowForm ] = useState ( false ) ;
@@ -112,14 +119,10 @@ export default function MesocycleDashboard() {
112119 const handleStartWorkout = ( splitDayId : string ) => {
113120 // Store the selected split day ID in localStorage for the workout session to pick up
114121 localStorage . setItem ( 'selectedSplitDayId' , splitDayId ) ;
115- // In a real app with routing, we would navigate to /workout
116- // For now, we'll just alert (the parent App component would handle navigation)
117- alert (
118- 'Navigate to workout session with split day: ' +
119- splitDayId +
120- '\n\n' +
121- 'Note: Full integration requires navigation support in the parent component.'
122- ) ;
122+ // Navigate to workout page
123+ if ( onNavigate ) {
124+ onNavigate ( 'workout' ) ;
125+ }
123126 } ;
124127
125128 return (
0 commit comments