Skip to content

Commit 6a805f9

Browse files
committed
chore(site): fix linter complaints in ChatPage
1 parent f355207 commit 6a805f9

File tree

7 files changed

+142
-117
lines changed

7 files changed

+142
-117
lines changed

site/pnpm-lock.yaml

Lines changed: 28 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/src/pages/ChatPage/ChatLanding.tsx

Lines changed: 1 addition & 2 deletions
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

Lines changed: 25 additions & 3 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy