okay good

This commit is contained in:
Mckay Wrigley
2023-03-22 11:07:42 -06:00
parent c9030c63ef
commit e8902354e4
3 changed files with 9 additions and 5 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
import { Conversation, KeyValuePair, Message, OpenAIModel } from "@/types";
import { FC, MutableRefObject, useEffect, useRef, useState } from 'react';
import { FC, MutableRefObject, useEffect, useRef, useState } from "react";
import { ChatInput } from "./ChatInput";
import { ChatLoader } from "./ChatLoader";
import { ChatMessage } from "./ChatMessage";
@@ -17,7 +17,7 @@ interface Props {
lightMode: "light" | "dark";
onSend: (message: Message, isResend: boolean) => void;
onUpdateConversation: (conversation: Conversation, data: KeyValuePair) => void;
stopConversationRef: MutableRefObject<boolean>
stopConversationRef: MutableRefObject<boolean>;
}
export const Chat: FC<Props> = ({ conversation, models, messageIsStreaming, modelError, messageError, loading, lightMode, onSend, onUpdateConversation, stopConversationRef }) => {
@@ -34,7 +34,7 @@ export const Chat: FC<Props> = ({ conversation, models, messageIsStreaming, mode
}, [conversation.messages]);
return (
<div className="relative flex-1 overflow-none dark:bg-[#343541]">
<div className="relative flex-1 overflow-none dark:bg-[#343541] bg-white">
{modelError ? (
<div className="flex flex-col justify-center mx-auto h-full w-[300px] sm:w-[500px] space-y-6">
<div className="text-center text-red-500">Error fetching models.</div>
+2 -2
View File
@@ -8,7 +8,7 @@ import { saveConversation, saveConversations, updateConversation } from "@/utils
import { exportConversations, importConversations } from "@/utils/app/data";
import { IconArrowBarLeft, IconArrowBarRight } from "@tabler/icons-react";
import Head from "next/head";
import { useEffect, useRef, useState } from 'react';
import { useEffect, useRef, useState } from "react";
export default function Home() {
const [conversations, setConversations] = useState<Conversation[]>([]);
@@ -54,7 +54,7 @@ export default function Home() {
prompt: updatedConversation.prompt
};
const controller = new AbortController()
const controller = new AbortController();
const response = await fetch("/api/chat", {
method: "POST",
headers: {
+4
View File
@@ -27,3 +27,7 @@
width: 6px;
height: 6px;
}
html {
background: #202123;
}