'use client' import * as React from 'react' import { createPortal } from 'react-dom' import { X, Keyboard, MousePointer, Monitor, HelpCircle } from 'lucide-react' import { cn } from '@/lib/utils' interface ShortcutItem { key: string description: string } const shortcuts: ShortcutItem[] = [ { key: 'Space / K', description: 'Play / Pause' }, { key: 'J / ←', description: 'Rewind 10s' }, { key: 'L / →', description: 'Forward 30s' }, { key: '↑ / ↓', description: 'Volume Up / Down' }, { key: 'M', description: 'Mute / Unmute' }, { key: 'F', description: 'Toggle Fullscreen' }, { key: ', / [', description: 'Decrease speed' }, { key: '. / ]', description: 'Increase speed' }, { key: '0-9', description: 'Seek to 0%-90%' }, { key: 'P / I', description: 'Toggle Picture-in-Picture' }, { key: 'Esc', description: 'Close overlay / exit fullscreen / exit PiP' }, { key: '?', description: 'Show / Hide This Overlay' }, ] export function KeyboardShortcutsOverlay({ isOpen, onClose }: { isOpen: boolean; onClose: () => void }) { if (!isOpen) return null return createPortal(
e.stopPropagation()} >

Keyboard Shortcuts

{shortcuts.map((item, index) => (
{item.key.split(' / ').map((k, i) => ( {i > 0 && /} {k.trim()} ))} {item.description}
))}
Press ? anywhere to toggle
, document.body ) }