99
1010import React from 'react' ;
1111import { AppShell } from '@object-ui/layout' ;
12- import { FloatingChatbot , useObjectChat } from '@object-ui/plugin-chatbot' ;
12+ import { FloatingChatbot , useObjectChat , type ChatMessage } from '@object-ui/plugin-chatbot' ;
1313import { AppSidebar } from './AppSidebar' ;
1414import { AppHeader } from './AppHeader' ;
1515import { useResponsiveSidebar } from '../hooks/useResponsiveSidebar' ;
1616import { resolveI18nLabel } from '../utils' ;
1717import type { ConnectionState } from '../dataSource' ;
1818
19+ /** Minimal object shape used by the chatbot context */
20+ interface ConsoleObject {
21+ name : string ;
22+ label ?: string ;
23+ }
24+
1925interface ConsoleLayoutProps {
2026 children : React . ReactNode ;
2127 activeAppName : string ;
@@ -32,8 +38,8 @@ function ConsoleLayoutInner({ children }: { children: React.ReactNode }) {
3238}
3339
3440/** Floating chatbot wired with useObjectChat for demo auto-response */
35- function ConsoleFloatingChatbot ( { appLabel, objects } : { appLabel : string ; objects : any [ ] } ) {
36- const objectNames = objects . map ( ( o : any ) => o . label || o . name ) . join ( ', ' ) ;
41+ function ConsoleFloatingChatbot ( { appLabel, objects } : { appLabel : string ; objects : ConsoleObject [ ] } ) {
42+ const objectNames = objects . map ( ( o ) => o . label || o . name ) . join ( ', ' ) ;
3743
3844 const {
3945 messages,
@@ -68,7 +74,7 @@ function ConsoleFloatingChatbot({ appLabel, objects }: { appLabel: string; objec
6874 title : `${ appLabel } Assistant` ,
6975 triggerSize : 56 ,
7076 } }
71- messages = { messages as any }
77+ messages = { messages as ChatMessage [ ] }
7278 placeholder = "Ask anything..."
7379 onSendMessage = { ( content : string ) => sendMessage ( content ) }
7480 onClear = { clear }
0 commit comments