Forráskód Böngészése

increase message limit to 5

Matthew Trejo 2 hónapja
szülő
commit
76a6147cb6
2 módosított fájl, 2 hozzáadás és 4 törlés
  1. 1 3
      src/components/chatbot/ChatInterface.tsx
  2. 1 1
      src/hooks/useChat.ts

+ 1 - 3
src/components/chatbot/ChatInterface.tsx

@@ -2,7 +2,7 @@
 
 import { useState, useEffect } from "react";
 import { useSession } from "next-auth/react";
-import { useChat } from "@/hooks/useChat";
+import { useChat, MAX_MESSAGES } from "@/hooks/useChat";
 import { useChatEffects } from "@/hooks/useChatEffects";
 import { ChatHeader } from "./ChatHeader";
 import { WelcomeMessage } from "./WelcomeMessage";
@@ -17,8 +17,6 @@ import { ResetConfirmationModal } from "./ResetConfirmationModal";
 import { AppointmentModalFromChat } from "./AppointmentModalFromChat";
 import { MedicalAlertBanner } from "./MedicalAlertBanner";
 
-const MAX_MESSAGES = 3;
-
 export const ChatInterface = () => {
   const { data: session } = useSession();
   const [showReportModal, setShowReportModal] = useState(false);

+ 1 - 1
src/hooks/useChat.ts

@@ -3,7 +3,7 @@ import { notifications } from "@/lib/notifications";
 import { generateReportFromMessages } from "@/utils/reports";
 import { Message, ChatState, ChatResponse, SuggestedPrompt, MedicalAlert } from "@/components/chatbot/types";
 
-const MAX_MESSAGES = 3;
+export const MAX_MESSAGES = 5;
 
 export const useChat = () => {
   const [messages, setMessages] = useState<Message[]>([]);