@@ -7,6 +7,7 @@ import { ChatTextIcon, PhoneDisconnectIcon } from '@phosphor-icons/react/dist/ss
77import { ChatInput } from '@/components/livekit/chat/chat-input' ;
88import { Button } from '@/components/ui/button' ;
99import { Toggle } from '@/components/ui/toggle' ;
10+ import { AppConfig } from '@/lib/types' ;
1011import { cn } from '@/lib/utils' ;
1112import { DeviceSelect } from '../device-select' ;
1213import { TrackToggle } from '../track-toggle' ;
@@ -15,6 +16,7 @@ import { UseAgentControlBarProps, useAgentControlBar } from './hooks/use-agent-c
1516export interface AgentControlBarProps
1617 extends React . HTMLAttributes < HTMLDivElement > ,
1718 UseAgentControlBarProps {
19+ capabilities : AppConfig [ 'capabilities' ] ;
1820 onSendMessage ?: ( message : string ) => Promise < void > ;
1921 onChatOpenChange ?: ( open : boolean ) => void ;
2022}
@@ -25,6 +27,7 @@ export interface AgentControlBarProps
2527export function AgentControlBar ( {
2628 controls,
2729 saveUserChoices = true ,
30+ capabilities,
2831 onDeviceError,
2932 onSendMessage,
3033 onChatOpenChange,
@@ -69,18 +72,20 @@ export function AgentControlBar({
6972 ) }
7073 { ...props }
7174 >
72- < div
73- inert = { ! chatOpen }
74- className = { cn (
75- 'overflow-hidden transition-[height] duration-300 ease-out' ,
76- chatOpen ? 'h-[57px]' : 'h-0'
77- ) }
78- >
79- < div className = "flex h-8 w-full" >
80- < ChatInput onSend = { handleSendMessage } disabled = { isSendingMessage } className = "w-full" />
75+ { capabilities . suportsChatInput && (
76+ < div
77+ inert = { ! chatOpen }
78+ className = { cn (
79+ 'overflow-hidden transition-[height] duration-300 ease-out' ,
80+ chatOpen ? 'h-[57px]' : 'h-0'
81+ ) }
82+ >
83+ < div className = "flex h-8 w-full" >
84+ < ChatInput onSend = { handleSendMessage } disabled = { isSendingMessage } className = "w-full" />
85+ </ div >
86+ < hr className = "my-3" />
8187 </ div >
82- < hr className = "my-3" />
83- </ div >
88+ ) }
8489
8590 < div className = "flex flex-row justify-between gap-1" >
8691 < div className = "flex w-full gap-1" >
@@ -109,7 +114,7 @@ export function AgentControlBar({
109114 </ div >
110115 ) }
111116
112- { visibleControls . camera && (
117+ { capabilities . suportsVideoInput && visibleControls . camera && (
113118 < div className = "flex items-center gap-0" >
114119 < TrackToggle
115120 className = "peer relative w-auto md:rounded-r-none md:border-r-0"
@@ -125,7 +130,7 @@ export function AgentControlBar({
125130 </ div >
126131 ) }
127132
128- { visibleControls . screenShare && (
133+ { capabilities . suportsScreenShare && visibleControls . screenShare && (
129134 < div className = "flex items-center gap-0" >
130135 < TrackToggle className = "relative w-auto" source = { Track . Source . ScreenShare } />
131136 </ div >
0 commit comments