'use client'; import { useTTS } from '@/contexts/TTSContext'; import { PlayIcon, PauseIcon, SkipForwardIcon, SkipBackwardIcon, } from '@/components/icons/Icons'; import { LoadingSpinner } from '@/components/Spinner'; import { VoicesControl } from '@/components/player/VoicesControl'; import { SpeedControl } from '@/components/player/SpeedControl'; import { Navigator } from '@/components/player/Navigator'; import { IconButton } from '@/components/ui'; export default function TTSPlayer({ currentPage, numPages, isPlaybackReady = true }: { currentPage?: number; numPages?: number | undefined; isPlaybackReady?: boolean; }) { const { isPlaying, togglePlay, skipForward, skipBackward, isProcessing, setSpeedAndRestart, setAudioPlayerSpeedAndRestart, setVoiceAndRestart, availableVoices, skipToLocation, } = useTTS(); return (
{/* Speed control */} {/* Page Navigation */} {currentPage && numPages && ( )} {/* Playback Controls */} {isProcessing ? : } {!isPlaying && !isPlaybackReady ? : (isPlaying ? : )} {isProcessing ? : } {/* Voice control */}
); }