import React from 'react'; import { WorkoutSession, WorkoutSet, WorkoutPlan, Language } from '../../types'; import { useTracker } from './useTracker'; import IdleView from './IdleView'; import SporadicView from './SporadicView'; import ActiveSessionView from './ActiveSessionView'; interface TrackerProps { userId: string; userWeight?: number; activeSession: WorkoutSession | null; activePlan: WorkoutPlan | null; onSessionStart: (plan?: WorkoutPlan, startWeight?: number) => void; onSessionEnd: () => void; onSessionQuit: () => void; onSetAdded: (set: WorkoutSet) => void; onRemoveSet: (setId: string) => void; onUpdateSet: (set: WorkoutSet) => void; onSporadicSetAdded?: () => void; lang: Language; } const Tracker: React.FC = (props) => { const tracker = useTracker(props); const { isSporadicMode } = tracker; const { activeSession, lang, onSessionEnd, onSessionQuit, onRemoveSet } = props; if (activeSession) { return ( ); } if (isSporadicMode) { return ; } return ; }; export default Tracker;