import { Volume2, VolumeX, Loader2 } from 'lucide-react' import { useTTS } from '@/hooks/useTTS' import { useMobile } from '@/hooks/useMobile' interface FloatingTTSButtonProps { content: string } export function FloatingTTSButton({ content }: FloatingTTSButtonProps) { const { speak, stop, isEnabled, isPlaying, isLoading, originalText } = useTTS() const isMobile = useMobile() if (!isEnabled || !content.trim()) { return null } const isThisPlaying = (isPlaying || isLoading) && originalText === content const handleClick = () => { if (isThisPlaying) { stop() } else { speak(content) } } const buttonPosition = isMobile ? 'bottom-24' : 'bottom-20' return ( ) }