import type { BackendName } from "../utils/audio-player" import { useTheme } from "@/context/ThemeContext" type PlaybackControlsProps = { isPlaying: boolean volume: number speed: number backendName?: BackendName hasAudioUrl?: boolean onToggle: () => void onPrev: () => void onNext: () => void onVolumeChange: (value: number) => void onSpeedChange: (value: number) => void } const BACKEND_LABELS: Record = { mpv: "mpv", ffplay: "ffplay", afplay: "afplay", system: "system", none: "none", } export function PlaybackControls(props: PlaybackControlsProps) { const { theme } = useTheme(); return ( [Prev] {props.isPlaying ? "[Pause]" : "[Play]"} [Next] Vol {Math.round(props.volume * 100)}% Speed {props.speed}x {props.backendName && props.backendName !== "none" && ( via {BACKEND_LABELS[props.backendName]} )} {props.backendName === "none" && ( No audio player found )} {props.hasAudioUrl === false && ( No audio URL )} ) }