openreader/src/components/player/RateLimitPauseButton.tsx
Richard R 4689f3676f refactor(auth): consolidate authentication contexts and enhance rate limit UI integration
Streamline auth client factory and remove redundant session manager
Introduce unified auto rate limit context for seamless status updates
Implement problem details in TTS responses for improved error clarity
Add rate limit pause controls and banners across document viewers
Refine PDF scaling logic with height-aware resize handling
Update privacy popup triggers and first-visit modal behavior

BREAKING CHANGE: Daily character limits adjusted (anonymous: 250K → 50K, authenticated: 1M → 500K)
2026-01-25 11:12:19 -07:00

25 lines
817 B
TypeScript

'use client';
import { Button } from '@headlessui/react';
import { PauseIcon } from '@/components/icons/Icons';
import { useTTS } from '@/contexts/TTSContext';
export function RateLimitPauseButton() {
const { isPlaying, togglePlay } = useTTS();
// Only show while audio is actively playing. This avoids presenting a "play" affordance
// when the user is rate-limited.
if (!isPlaying) return null;
return (
<Button
onClick={() => {
if (isPlaying) togglePlay();
}}
className="relative p-1.5 rounded-md text-foreground hover:bg-offbase transition-all duration-200 focus:outline-none h-8 w-8 flex items-center justify-center transform ease-in-out hover:scale-[1.09] hover:text-accent"
aria-label="Pause"
>
<PauseIcon className="w-5 h-5" />
</Button>
);
}