Skip to content

Commit 12a2786

Browse files
committed
Fix build errors
1 parent 882c294 commit 12a2786

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

web/src/app/chat/components/ChatPage.tsx

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import { redirect, useRouter, useSearchParams } from "next/navigation";
44
import { ChatSession, ChatSessionSharedStatus, Message } from "../interfaces";
5-
65
import { HealthCheckBanner } from "@/components/health/healthcheck";
76
import { personaIncludesRetrieval, useScrollonStream } from "../services/lib";
87
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
@@ -31,11 +30,9 @@ import TextView from "@/components/chat/TextView";
3130
import { Modal } from "@/components/Modal";
3231
import { useSendMessageToParent } from "@/lib/extension/utils";
3332
import { SUBMIT_MESSAGE_TYPES } from "@/lib/extension/constants";
34-
3533
import { getSourceMetadata } from "@/lib/sources";
3634
import { UserSettingsModal } from "./modal/UserSettingsModal";
3735
import { FilePickerModal } from "../my-documents/components/FilePicker";
38-
3936
import { SourceMetadata } from "@/lib/search/interfaces";
4037
import { FederatedConnectorDetail, ValidSources } from "@/lib/types";
4138
import { useDocumentsContext } from "../my-documents/DocumentsContext";
@@ -65,7 +62,6 @@ import {
6562
useHasSentLocalUserMessage,
6663
} from "../stores/useChatSessionStore";
6764
import { FederatedOAuthModal } from "@/components/chat/FederatedOAuthModal";
68-
import { AssistantIcon } from "@/components/assistants/AssistantIcon";
6965
import { StarterMessageDisplay } from "./starterMessages/StarterMessageDisplay";
7066
import { MessagesDisplay } from "./MessagesDisplay";
7167
import { WelcomeMessage } from "./WelcomeMessage";
@@ -75,9 +71,7 @@ interface ChatPageProps {
7571
firstMessage?: string;
7672
}
7773

78-
export function ChatPage({
79-
firstMessage,
80-
}: ChatPageProps) {
74+
export function ChatPage({ firstMessage }: ChatPageProps) {
8175
// Performance tracking
8276
// Keeping this here in case we need to track down slow renders in the future
8377
// const renderCount = useRef(0);
@@ -411,7 +405,9 @@ export function ChatPage({
411405

412406
// Access chat state directly from the store
413407
const currentChatState = useCurrentChatState();
414-
const chatSessionId = useChatSessionStore((state) => state.currentSessionId);
408+
const chatSessionId = useChatSessionStore(
409+
(state: any) => state.currentSessionId
410+
);
415411
const submittedMessage = useSubmittedMessage();
416412
const loadingError = useLoadingError();
417413
const uncaughtError = useUncaughtError();
@@ -425,13 +421,13 @@ export function ChatPage({
425421
const documentSidebarVisible = useDocumentSidebarVisible();
426422
const chatSessionSharedStatus = useChatSessionSharedStatus();
427423
const updateHasPerformedInitialScroll = useChatSessionStore(
428-
(state) => state.updateHasPerformedInitialScroll
424+
(state: any) => state.updateHasPerformedInitialScroll
429425
);
430426
const updateCurrentDocumentSidebarVisible = useChatSessionStore(
431-
(state) => state.updateCurrentDocumentSidebarVisible
427+
(state: any) => state.updateCurrentDocumentSidebarVisible
432428
);
433429
const updateCurrentChatSessionSharedStatus = useChatSessionStore(
434-
(state) => state.updateCurrentChatSessionSharedStatus
430+
(state: any) => state.updateCurrentChatSessionSharedStatus
435431
);
436432

437433
const clientScrollToBottom = useCallback(
@@ -913,12 +909,13 @@ export function ChatPage({
913909
/>
914910
</div>
915911

916-
<dv
912+
<div
917913
ref={inputRef}
918-
className={`absolute pointer-events-none z-10 w-full ${showCenteredInput
914+
className={`absolute pointer-events-none z-10 w-full ${
915+
showCenteredInput
919916
? "inset-0"
920917
: "bottom-0 left-0 right-0 translate-y-0"
921-
}`}
918+
}`}
922919
>
923920
{!showCenteredInput && aboveHorizon && (
924921
<div className="mx-auto w-fit !pointer-events-none flex sticky justify-center">
@@ -932,10 +929,11 @@ export function ChatPage({
932929
)}
933930

934931
<div
935-
className={`pointer-events-auto w-[95%] mx-auto relative text-text-600 ${showCenteredInput
932+
className={`pointer-events-auto w-[95%] mx-auto relative text-text-600 ${
933+
showCenteredInput
936934
? "h-full grid grid-rows-[0.85fr_auto_1.15fr]"
937935
: "mb-8"
938-
}`}
936+
}`}
939937
>
940938
{showCenteredInput && (
941939
<WelcomeMessage assistant={liveAssistant} />
@@ -962,9 +960,7 @@ export function ChatPage({
962960
stopGenerating={stopGenerating}
963961
onSubmit={handleChatInputSubmit}
964962
chatState={currentChatState}
965-
selectedAssistant={
966-
selectedAssistant || liveAssistant
967-
}
963+
selectedAssistant={selectedAssistant || liveAssistant}
968964
handleFileUpload={handleMessageSpecificFileUpload}
969965
textAreaRef={textAreaRef}
970966
/>

0 commit comments

Comments
 (0)