move chatbox.tsx to pages/
This commit is contained in:
@@ -4,7 +4,7 @@ import "@/global.css";
|
|||||||
|
|
||||||
import { calculate_token_length } from "@/chatgpt";
|
import { calculate_token_length } from "@/chatgpt";
|
||||||
import { getDefaultParams } from "@/utils/getDefaultParam";
|
import { getDefaultParams } from "@/utils/getDefaultParam";
|
||||||
import ChatBOX from "@/chatbox";
|
import ChatBOX from "@/pages/chatbox";
|
||||||
import { DefaultModel } from "@/const";
|
import { DefaultModel } from "@/const";
|
||||||
import { Tr, langCodeContext, LANG_OPTIONS } from "@/translate";
|
import { Tr, langCodeContext, LANG_OPTIONS } from "@/translate";
|
||||||
import { ChatStore } from "@/types/chatstore";
|
import { ChatStore } from "@/types/chatstore";
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
MagnifyingGlassIcon,
|
|
||||||
CubeIcon,
|
CubeIcon,
|
||||||
BanknotesIcon,
|
BanknotesIcon,
|
||||||
DocumentTextIcon,
|
|
||||||
ChatBubbleLeftEllipsisIcon,
|
ChatBubbleLeftEllipsisIcon,
|
||||||
ScissorsIcon,
|
ScissorsIcon,
|
||||||
SwatchIcon,
|
SwatchIcon,
|
||||||
@@ -25,7 +23,6 @@ import {
|
|||||||
import { addTotalCost, getTotalCost } from "@/utils/totalCost";
|
import { addTotalCost, getTotalCost } from "@/utils/totalCost";
|
||||||
import ChatGPT, {
|
import ChatGPT, {
|
||||||
calculate_token_length,
|
calculate_token_length,
|
||||||
ChunkMessage,
|
|
||||||
FetchResponse,
|
FetchResponse,
|
||||||
Message as MessageType,
|
Message as MessageType,
|
||||||
MessageDetail,
|
MessageDetail,
|
||||||
@@ -38,7 +35,7 @@ import {
|
|||||||
TemplateChatStore,
|
TemplateChatStore,
|
||||||
TemplateAPI,
|
TemplateAPI,
|
||||||
TemplateTools,
|
TemplateTools,
|
||||||
} from "./types/chatstore";
|
} from "../types/chatstore";
|
||||||
import Message from "@/message";
|
import Message from "@/message";
|
||||||
import { models } from "@/types/models";
|
import { models } from "@/types/models";
|
||||||
import Settings from "@/settings";
|
import Settings from "@/settings";
|
||||||
@@ -660,58 +657,6 @@ export default function ChatBOX(props: {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* <div
|
|
||||||
className="relative cursor-pointer rounded p-2"
|
|
||||||
onClick={() => setShowSettings(true)}
|
|
||||||
>
|
|
||||||
<button
|
|
||||||
className="absolute right-1 rounded p-1 m-1"
|
|
||||||
onClick={(event) => {
|
|
||||||
// stop propagation to parent
|
|
||||||
event.stopPropagation();
|
|
||||||
|
|
||||||
setShowSearch(true);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<MagnifyingGlassIcon className="w-5 h-5" />
|
|
||||||
</button>
|
|
||||||
<div className="hidden lg:inline-grid"></div>
|
|
||||||
<div className="lg:hidden">
|
|
||||||
<div>
|
|
||||||
<button className="underline">
|
|
||||||
{chatStore.systemMessageContent.length > 16
|
|
||||||
? chatStore.systemMessageContent.slice(0, 16) + ".."
|
|
||||||
: chatStore.systemMessageContent}
|
|
||||||
</button>{" "}
|
|
||||||
<button className="underline">
|
|
||||||
{chatStore.streamMode ? Tr("STREAM") : Tr("FETCH")}
|
|
||||||
</button>{" "}
|
|
||||||
{chatStore.toolsString.trim() && (
|
|
||||||
<button className="underline">TOOL</button>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
<div className="text-xs">
|
|
||||||
<span className="underline">{chatStore.model}</span>{" "}
|
|
||||||
<span>
|
|
||||||
Tokens:{" "}
|
|
||||||
<span className="underline">
|
|
||||||
{chatStore.totalTokens}/{chatStore.maxTokens}
|
|
||||||
</span>
|
|
||||||
</span>{" "}
|
|
||||||
<span>
|
|
||||||
{Tr("Cut")}:{" "}
|
|
||||||
<span className="underline">
|
|
||||||
{chatStore.postBeginIndex}/
|
|
||||||
{chatStore.history.filter(({ hide }) => !hide).length}
|
|
||||||
</span>{" "}
|
|
||||||
</span>{" "}
|
|
||||||
<span>
|
|
||||||
{Tr("Cost")}:{" "}
|
|
||||||
<span className="underline">${chatStore.cost.toFixed(4)}</span>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div> */}
|
|
||||||
<div className="grow overflow-scroll">
|
<div className="grow overflow-scroll">
|
||||||
{!chatStore.apiKey && (
|
{!chatStore.apiKey && (
|
||||||
<p className="bg-base-200 p-6 rounded my-3 text-left">
|
<p className="bg-base-200 p-6 rounded my-3 text-left">
|
||||||
Reference in New Issue
Block a user