Skip to content

Commit e7559c3

Browse files
committed
chore(site): fix linter complaints in ChatPage
1 parent 8105e90 commit e7559c3

7 files changed

+142
-117
lines changed

site/pnpm-lock.yaml

+28-34
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/src/pages/ChatPage/ChatLanding.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import TextField from "@mui/material/TextField";
88
import { createChat } from "api/queries/chats";
99
import type { Chat } from "api/typesGenerated";
1010
import { Margins } from "components/Margins/Margins";
11-
import { useAuthenticated } from "contexts/auth/RequireAuth";
11+
import { useAuthenticated } from "hooks";
1212
import { type FC, type FormEvent, useState } from "react";
1313
import { useMutation, useQueryClient } from "react-query";
1414
import { useNavigate } from "react-router-dom";
@@ -35,7 +35,6 @@ export const ChatLanding: FC = () => {
3535
const handleFormSubmit = (e: FormEvent<HTMLFormElement>) => {
3636
e.preventDefault();
3737
if (!input.trim()) return;
38-
console.log("Form submitted with input:", input);
3938
// Actual submission logic will go elsewhere
4039
setInput(""); // Clear input after submit (optional)
4140

site/src/pages/ChatPage/ChatLayout.tsx

+25-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ import ListItemText from "@mui/material/ListItemText";
88
import Paper from "@mui/material/Paper";
99
import { createChat, getChats } from "api/queries/chats";
1010
import { deploymentLanguageModels } from "api/queries/deployment";
11-
import { Chat, type LanguageModelConfig } from "api/typesGenerated";
11+
import type { LanguageModelConfig } from "api/typesGenerated";
1212
import { ErrorAlert } from "components/Alert/ErrorAlert";
1313
import { Loader } from "components/Loader/Loader";
14+
import { Margins } from "components/Margins/Margins";
15+
import { useAgenticChat } from "contexts/useAgenticChat";
1416
import {
1517
type FC,
1618
type PropsWithChildren,
@@ -28,7 +30,6 @@ export interface ChatContext {
2830

2931
setSelectedModel: (model: string) => void;
3032
}
31-
3233
export const useChatContext = (): ChatContext => {
3334
const context = useContext(ChatContext);
3435
if (!context) {
@@ -87,6 +88,7 @@ export const ChatProvider: FC<PropsWithChildren> = ({ children }) => {
8788
};
8889

8990
export const ChatLayout: FC = () => {
91+
const agenticChat = useAgenticChat();
9092
const queryClient = useQueryClient();
9193
const { data: chats, isLoading: chatsLoading } = useQuery(getChats());
9294
const createChatMutation = useMutation(createChat(queryClient));
@@ -98,7 +100,27 @@ export const ChatLayout: FC = () => {
98100
navigate("/chat");
99101
};
100102

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+
}
102124

103125
return (
104126
// Outermost container: controls height and prevents page scroll

0 commit comments

Comments
 (0)