@@ -15,25 +15,22 @@ import { ChatMessageView } from '@/components/livekit/chat/chat-message-view';
1515import { MediaTiles } from '@/components/livekit/media-tiles' ;
1616import useChatAndTranscription from '@/hooks/useChatAndTranscription' ;
1717import { useDebugMode } from '@/hooks/useDebug' ;
18+ import type { AppConfig } from '@/lib/types' ;
1819import { cn } from '@/lib/utils' ;
1920
2021function isAgentAvailable ( agentState : AgentState ) {
2122 return agentState == 'listening' || agentState == 'thinking' || agentState == 'speaking' ;
2223}
2324
2425interface SessionViewProps {
26+ appConfig : AppConfig ;
2527 disabled : boolean ;
26- capabilities : {
27- supportsChatInput : boolean ;
28- supportsVideoInput : boolean ;
29- supportsScreenShare : boolean ;
30- } ;
3128 sessionStarted : boolean ;
3229}
3330
3431export const SessionView = ( {
32+ appConfig,
3533 disabled,
36- capabilities,
3734 sessionStarted,
3835 ref,
3936} : React . ComponentProps < 'div' > & SessionViewProps ) => {
@@ -82,6 +79,13 @@ export const SessionView = ({
8279 }
8380 } , [ agentState , sessionStarted , room ] ) ;
8481
82+ const { supportsChatInput, supportsVideoInput, supportsScreenShare } = appConfig ;
83+ const capabilities = {
84+ supportsChatInput,
85+ supportsVideoInput,
86+ supportsScreenShare,
87+ } ;
88+
8589 return (
8690 < main
8791 ref = { ref }
@@ -133,26 +137,28 @@ export const SessionView = ({
133137 transition = { { duration : 0.3 , delay : sessionStarted ? 0.5 : 0 , ease : 'easeOut' } }
134138 >
135139 < div className = "relative z-10 mx-auto w-full max-w-2xl" >
136- < motion . div
137- initial = { { opacity : 0 } }
138- animate = { {
139- opacity : sessionStarted && messages . length === 0 ? 1 : 0 ,
140- transition : {
141- ease : 'easeIn' ,
142- delay : messages . length > 0 ? 0 : 0.8 ,
143- duration : messages . length > 0 ? 0.2 : 0.5 ,
144- } ,
145- } }
146- aria-hidden = { messages . length > 0 }
147- className = { cn (
148- 'absolute inset-x-0 -top-12 text-center' ,
149- sessionStarted && messages . length === 0 && 'pointer-events-none'
150- ) }
151- >
152- < p className = "animate-text-shimmer inline-block !bg-clip-text text-sm font-semibold text-transparent" >
153- Agent is listening, ask it a question
154- </ p >
155- </ motion . div >
140+ { appConfig . isPreConnectBufferEnabled && (
141+ < motion . div
142+ initial = { { opacity : 0 } }
143+ animate = { {
144+ opacity : sessionStarted && messages . length === 0 ? 1 : 0 ,
145+ transition : {
146+ ease : 'easeIn' ,
147+ delay : messages . length > 0 ? 0 : 0.8 ,
148+ duration : messages . length > 0 ? 0.2 : 0.5 ,
149+ } ,
150+ } }
151+ aria-hidden = { messages . length > 0 }
152+ className = { cn (
153+ 'absolute inset-x-0 -top-12 text-center' ,
154+ sessionStarted && messages . length === 0 && 'pointer-events-none'
155+ ) }
156+ >
157+ < p className = "animate-text-shimmer inline-block !bg-clip-text text-sm font-semibold text-transparent" >
158+ Agent is listening, ask it a question
159+ </ p >
160+ </ motion . div >
161+ ) }
156162
157163 < AgentControlBar
158164 capabilities = { capabilities }
0 commit comments