import React from "react"; import { useTVModeStore } from "../../stores/tvModeStore"; export const TVModeControls = ({ visible, isPlaying, currentIndex, totalScenes, isPrefetching, isWaitingForNextImage = false, onTogglePlay, onPrev, onNext, onExit, onGoToScene, onShowSettings, ttsEnabled = false, ttsSupported = false, isSpeaking = false, onToggleTTS, }) => { const { storyTitle } = useTVModeStore(); const progress = totalScenes > 0 ? ((currentIndex + 1) / totalScenes) * 100 : 0; const handleProgressClick = (e) => { const rect = e.currentTarget.getBoundingClientRect(); const clickX = e.clientX - rect.left; const percentage = clickX / rect.width; const sceneIndex = Math.floor(percentage * totalScenes); onGoToScene(Math.min(Math.max(sceneIndex, 0), totalScenes - 1)); }; return (
{/* Top Bar */}

{storyTitle}

{currentIndex + 1} / {totalScenes} {/* TTS Toggle Button */} {ttsSupported && onToggleTTS && ()}
{/* Bottom Bar */}
{/* Playback Controls */}
{/* Progress Bar */}
{/* Scene markers */}
{Array.from({ length: totalScenes }).map((_, i) => (
{ e.stopPropagation(); onGoToScene(i); }}/>))}
{/* Generating indicator */} {(isPrefetching || isWaitingForNextImage) && (
{isPrefetching ? "Generating next scene..." : "Waiting for image..."}
)}
); }; export default TVModeControls;