@@ -8,9 +8,11 @@ import ListItemText from "@mui/material/ListItemText";
8
8
import Paper from "@mui/material/Paper" ;
9
9
import { createChat , getChats } from "api/queries/chats" ;
10
10
import { deploymentLanguageModels } from "api/queries/deployment" ;
11
- import { Chat , type LanguageModelConfig } from "api/typesGenerated" ;
11
+ import type { LanguageModelConfig } from "api/typesGenerated" ;
12
12
import { ErrorAlert } from "components/Alert/ErrorAlert" ;
13
13
import { Loader } from "components/Loader/Loader" ;
14
+ import { Margins } from "components/Margins/Margins" ;
15
+ import { useAgenticChat } from "contexts/useAgenticChat" ;
14
16
import {
15
17
type FC ,
16
18
type PropsWithChildren ,
@@ -28,7 +30,6 @@ export interface ChatContext {
28
30
29
31
setSelectedModel : ( model : string ) => void ;
30
32
}
31
-
32
33
export const useChatContext = ( ) : ChatContext => {
33
34
const context = useContext ( ChatContext ) ;
34
35
if ( ! context ) {
@@ -87,6 +88,7 @@ export const ChatProvider: FC<PropsWithChildren> = ({ children }) => {
87
88
} ;
88
89
89
90
export const ChatLayout : FC = ( ) => {
91
+ const agenticChat = useAgenticChat ( ) ;
90
92
const queryClient = useQueryClient ( ) ;
91
93
const { data : chats , isLoading : chatsLoading } = useQuery ( getChats ( ) ) ;
92
94
const createChatMutation = useMutation ( createChat ( queryClient ) ) ;
@@ -98,7 +100,27 @@ export const ChatLayout: FC = () => {
98
100
navigate ( "/chat" ) ;
99
101
} ;
100
102
101
- console . log ( chats ) ;
103
+ if ( ! agenticChat . enabled ) {
104
+ return (
105
+ < Margins >
106
+ < div
107
+ css = { {
108
+ display : "flex" ,
109
+ flexDirection : "column" ,
110
+ marginTop : "24px" ,
111
+ alignItems : "center" ,
112
+ paddingBottom : "16px" ,
113
+ } }
114
+ >
115
+ < h1 > Agentic Chat is not enabled</ h1 >
116
+ < p >
117
+ Agentic Chat is an experimental feature and is not enabled by
118
+ default. Please contact your administrator for more information.
119
+ </ p >
120
+ </ div >
121
+ </ Margins >
122
+ ) ;
123
+ }
102
124
103
125
return (
104
126
// Outermost container: controls height and prevents page scroll
0 commit comments