import { useVoiceStore } from '../stores/voice.ts'; import { VoiceControls } from './VoiceControls.tsx'; export function VoicePanel() { const isConnected = useVoiceStore((state) => state.isConnected); const currentRoom = useVoiceStore((state) => state.currentRoom); const currentRoomName = useVoiceStore((state) => state.currentRoomName); const participants = useVoiceStore((state) => state.participants); const error = useVoiceStore((state) => state.error); if (!currentRoom) return null; return (
{/* Box-drawn header */}
┌─┤ VOICE ├─{'─'.repeat(Math.max(0, 20 - (currentRoomName?.length ?? 0)))}┐ {currentRoomName || currentRoom} {isConnected ? '● LIVE' : '◐ connecting...'}
{/* Error display */} {error && (
! {error}
)} {/* Participants */}
── participants ──
{participants.length === 0 && (
[empty channel]
)} {participants.map((p) => (
{p.isMuted ? '○' : '●'} {p.username} {p.isMuted && ( [muted] )} {p.isSpeaking && ( [speaking] )}
))}
{/* Controls */}
{/* Box-drawn footer */}
└{'─'.repeat(40)}┘
); }