import { useTranslation } from 'react-i18next'; import { HeadphonesIcon, HeadphonesOffIcon, MicIcon, MicOffIcon, MonitorShareIcon, MonitorStopIcon, MusicIcon, PhoneOffIcon, UsersIcon, VideoIcon, } from './icons'; interface Props { muted: boolean; sharing: boolean; video: boolean; deafened: boolean; onToggleMute: () => void; onToggleShare: () => void; /** Right-click on the share button opens the quality picker dialog while * left-click just starts with last-used settings. Optional so pages that * don't need the advanced path (mobile, etc.) can skip it. */ onShareContextMenu?: (e: React.MouseEvent) => void; onToggleVideo?: () => void; onToggleDeafen: () => void; onHangup: () => void; onOpenParticipants?: () => void; /** Toggle the in-call soundboard popover. Active = panel currently open. */ onToggleSoundboard?: () => void; soundboardOpen?: boolean; participantsOpen?: boolean; /** Compact variant used inside the docked call (36px buttons). */ compact?: boolean; /** Glass variant used when controls float on fullscreen cinema mode. */ glass?: boolean; /** Disable transient interactions while the call isn't fully connected. */ disabledMedia?: boolean; } export function CallControls({ muted, sharing, video, deafened, onToggleMute, onToggleShare, onShareContextMenu, onToggleVideo, onToggleDeafen, onHangup, onOpenParticipants, onToggleSoundboard, soundboardOpen = false, participantsOpen = false, compact = false, glass = false, disabledMedia = false, }: Props) { const { t } = useTranslation(['app']); const wrapBase = glass ? 'glass-pill flex items-center justify-center gap-2 rounded-[18px] p-2.5' : 'flex items-center justify-center gap-2 border-t border-line bg-surface-3 p-3'; const btnSize = compact ? 'h-9 w-9 rounded-[10px]' : 'h-12 w-12 rounded-[14px]'; const hangupSize = compact ? 'h-9 w-[54px] rounded-[10px]' : 'h-12 w-[72px] rounded-[14px]'; return (