11'use client' ;
22
33import React , { useEffect } from 'react' ;
4- import { motion } from 'motion/react' ;
54import { Track } from 'livekit-client' ;
5+ import { motion } from 'motion/react' ;
66import {
77 type AgentState ,
8+ BarVisualizer ,
89 useRoomContext ,
910 useVoiceAssistant ,
10- BarVisualizer ,
1111} from '@livekit/components-react' ;
1212import { PhoneDisconnectIcon } from '@phosphor-icons/react/dist/ssr' ;
13-
1413import { toastAlert } from '@/components/alert-toast' ;
15- import { Button } from '@/components/ui/button' ;
1614import { DeviceSelect } from '@/components/livekit/device-select' ;
1715import { TrackToggle } from '@/components/livekit/track-toggle' ;
16+ import { Button } from '@/components/ui/button' ;
1817import { useDebugMode } from '@/hooks/useDebug' ;
1918import type { AppConfig } from '@/lib/types' ;
2019import { cn } from '@/lib/utils' ;
21-
2220import { useAgentControlBar } from './hooks/use-agent-control-bar' ;
2321
2422function isAgentAvailable ( agentState : AgentState ) {
@@ -48,7 +46,7 @@ export const SessionView = ({
4846 handleDisconnect,
4947 } = useAgentControlBar ( {
5048 controls : { microphone : true } ,
51- saveUserChoices : true
49+ saveUserChoices : true ,
5250 } ) ;
5351
5452 const onLeave = ( ) => {
@@ -105,11 +103,8 @@ export const SessionView = ({
105103 } }
106104 transition = { { duration : 0.3 , delay : sessionStarted ? 0.5 : 0 , ease : 'easeOut' } }
107105 >
108- < div
109- aria-label = "Voice assistant controls"
110- className = "absolute inset-0"
111- >
112- < div className = "flex flex-row items-center justify-between h-full gap-1 px-3" >
106+ < div aria-label = "Voice assistant controls" className = "absolute inset-0" >
107+ < div className = "flex h-full flex-row items-center justify-between gap-1 px-3" >
113108 < div className = "flex gap-1" >
114109 { visibleControls . microphone ? (
115110 < div className = "flex items-center gap-0" >
@@ -159,7 +154,7 @@ export const SessionView = ({
159154 </ div >
160155
161156 { appConfig . isPreConnectBufferEnabled ? (
162- < div className = "absolute left-1/2 - translate-x-1/2 h-full flex justify- center items -center gap-2" >
157+ < div className = "absolute left-1/2 flex h-full - translate-x-1/2 items- center justify -center gap-2" >
163158 < BarVisualizer
164159 barCount = { 3 }
165160 trackRef = { agentAudioTrack }
@@ -184,8 +179,8 @@ export const SessionView = ({
184179 { visibleControls . leave ? (
185180 < Button variant = "destructive" onClick = { onLeave } className = "font-mono" >
186181 < PhoneDisconnectIcon weight = "bold" />
187- < span className = "hidden md:inline uppercase " > End Call</ span >
188- < span className = "inline md:hidden uppercase " > End</ span >
182+ < span className = "hidden uppercase md:inline" > End Call</ span >
183+ < span className = "inline uppercase md:hidden" > End</ span >
189184 </ Button >
190185 ) : null }
191186 </ div >
0 commit comments