okay good
This commit is contained in:
parent
c9030c63ef
commit
e8902354e4
|
@ -1,5 +1,5 @@
|
||||||
import { Conversation, KeyValuePair, Message, OpenAIModel } from "@/types";
|
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 { ChatInput } from "./ChatInput";
|
||||||
import { ChatLoader } from "./ChatLoader";
|
import { ChatLoader } from "./ChatLoader";
|
||||||
import { ChatMessage } from "./ChatMessage";
|
import { ChatMessage } from "./ChatMessage";
|
||||||
|
@ -17,7 +17,7 @@ interface Props {
|
||||||
lightMode: "light" | "dark";
|
lightMode: "light" | "dark";
|
||||||
onSend: (message: Message, isResend: boolean) => void;
|
onSend: (message: Message, isResend: boolean) => void;
|
||||||
onUpdateConversation: (conversation: Conversation, data: KeyValuePair) => 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 }) => {
|
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]);
|
}, [conversation.messages]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="relative flex-1 overflow-none dark:bg-[#343541]">
|
<div className="relative flex-1 overflow-none dark:bg-[#343541] bg-white">
|
||||||
{modelError ? (
|
{modelError ? (
|
||||||
<div className="flex flex-col justify-center mx-auto h-full w-[300px] sm:w-[500px] space-y-6">
|
<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>
|
<div className="text-center text-red-500">Error fetching models.</div>
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { saveConversation, saveConversations, updateConversation } from "@/utils
|
||||||
import { exportConversations, importConversations } from "@/utils/app/data";
|
import { exportConversations, importConversations } from "@/utils/app/data";
|
||||||
import { IconArrowBarLeft, IconArrowBarRight } from "@tabler/icons-react";
|
import { IconArrowBarLeft, IconArrowBarRight } from "@tabler/icons-react";
|
||||||
import Head from "next/head";
|
import Head from "next/head";
|
||||||
import { useEffect, useRef, useState } from 'react';
|
import { useEffect, useRef, useState } from "react";
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
const [conversations, setConversations] = useState<Conversation[]>([]);
|
const [conversations, setConversations] = useState<Conversation[]>([]);
|
||||||
|
@ -54,7 +54,7 @@ export default function Home() {
|
||||||
prompt: updatedConversation.prompt
|
prompt: updatedConversation.prompt
|
||||||
};
|
};
|
||||||
|
|
||||||
const controller = new AbortController()
|
const controller = new AbortController();
|
||||||
const response = await fetch("/api/chat", {
|
const response = await fetch("/api/chat", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
|
|
|
@ -27,3 +27,7 @@
|
||||||
width: 6px;
|
width: 6px;
|
||||||
height: 6px;
|
height: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
html {
|
||||||
|
background: #202123;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue