mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-14 04:36:52 +08:00
Fix: Hide the reset button on the embedded page that is in conversation (#18153)
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user