Fix: Hide the reset button on the embedded page that is in conversation (#18153)

This commit is contained in:
balibabu
2026-08-12 15:45:16 +08:00
committed by GitHub
parent 86b6f64abb
commit 6152f7e6bf
3 changed files with 16 additions and 10 deletions

View File

@@ -24,6 +24,7 @@ type EmbedContainerProps = {
title: string;
avatar?: string;
handleReset?(): void;
hideReset?: boolean;
} & PropsWithChildren;
export function EmbedContainer({
@@ -31,6 +32,7 @@ export function EmbedContainer({
avatar,
children,
handleReset,
hideReset = false,
}: EmbedContainerProps) {
const appConf = useFetchAppConf();
@@ -54,16 +56,18 @@ export function EmbedContainer({
<div className="flex md:hidden items-center">
<img src="/logo.svg" alt="" className="h-6" />
</div>
<Button
variant={'secondary'}
className="text-sm text-foreground cursor-pointer"
onClick={handleReset}
>
<div className="flex gap-1 items-center">
<RefreshCcw size={14} />
<span className="hidden text-lg md:inline-block">Reset</span>
</div>
</Button>
{hideReset || (
<Button
variant={'secondary'}
className="text-sm text-foreground cursor-pointer"
onClick={handleReset}
>
<div className="flex gap-1 items-center">
<RefreshCcw size={14} />
<span className="hidden text-lg md:inline-block">Reset</span>
</div>
</Button>
)}
</div>
{children}
</div>

View File

@@ -121,6 +121,7 @@ const ChatContainer = () => {
title={inputsData.title}
avatar={inputsData.avatar}
handleReset={handleReset}
hideReset={sendLoading}
>
<div className="flex flex-1 flex-col p-2.5 h-[90vh] m-3">
<div

View File

@@ -60,6 +60,7 @@ const ChatContainer = () => {
title={chatInfo.title}
avatar={chatInfo.avatar}
handleReset={removeAllMessagesExceptFirst}
hideReset={sendLoading}
>
<div className="flex flex-1 flex-col p-2.5 h-[90vh] m-3">
<div