refactor Chatbox component layout and restore stop generating button
This commit is contained in:
@@ -602,21 +602,6 @@ export default function ChatBOX() {
|
|||||||
<Tr>New Chat</Tr>
|
<Tr>New Chat</Tr>
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
{showGenerating && (
|
|
||||||
<Button
|
|
||||||
size="sm"
|
|
||||||
className="ml-auto gap-1.5"
|
|
||||||
variant="destructive"
|
|
||||||
onClick={() => {
|
|
||||||
abortControllerRef.current.abort();
|
|
||||||
setShowGenerating(false);
|
|
||||||
setGeneratingMessage("");
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Tr>Stop Generating</Tr>
|
|
||||||
<ScissorsIcon className="size-3.5" />
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
{chatStore.develop_mode && chatStore.history.length > 0 && (
|
{chatStore.develop_mode && chatStore.history.length > 0 && (
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
@@ -677,9 +662,10 @@ export default function ChatBOX() {
|
|||||||
</div>
|
</div>
|
||||||
<div className="sticky bottom-0 w-full z-20 bg-background">
|
<div className="sticky bottom-0 w-full z-20 bg-background">
|
||||||
{generatingMessage && (
|
{generatingMessage && (
|
||||||
<div className="flex items-center justify-end gap-2 p-2 m-2 rounded bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60">
|
<div className="flex items-center justify-between gap-2 p-2 m-2 rounded bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60">
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
<label className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70">
|
<label className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70">
|
||||||
Follow
|
<Tr>Follow</Tr>
|
||||||
</label>
|
</label>
|
||||||
<Switch
|
<Switch
|
||||||
checked={follow}
|
checked={follow}
|
||||||
@@ -687,6 +673,22 @@ export default function ChatBOX() {
|
|||||||
aria-label="Toggle auto-scroll"
|
aria-label="Toggle auto-scroll"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
<Button
|
||||||
|
size="sm"
|
||||||
|
className="ml-auto gap-1.5"
|
||||||
|
variant="destructive"
|
||||||
|
onClick={() => {
|
||||||
|
abortControllerRef.current.abort();
|
||||||
|
setShowGenerating(false);
|
||||||
|
setGeneratingMessage("");
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Tr>Stop Generating</Tr>
|
||||||
|
<ScissorsIcon className="size-3.5" />
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
<form className="relative rounded-lg border bg-background focus-within:ring-1 focus-within:ring-ring p-1">
|
<form className="relative rounded-lg border bg-background focus-within:ring-1 focus-within:ring-ring p-1">
|
||||||
<ChatInput
|
<ChatInput
|
||||||
|
|||||||
Reference in New Issue
Block a user