Commit 0c67f369 by 杨明

重新生成

1 parent e948cb6f
......@@ -24,6 +24,7 @@ type AnswerProps = {
config?: ChatConfig;
answerIcon?: ReactNode;
responding?: boolean;
isLast?: boolean;
showPromptLog?: boolean;
chatAnswerContainerInner?: string;
hideProcessDetail?: boolean;
......@@ -39,6 +40,7 @@ const Answer: FC<AnswerProps> = ({
answerIcon,
responding,
showPromptLog,
isLast,
chatAnswerContainerInner,
hideProcessDetail,
appData,
......@@ -119,6 +121,7 @@ const Answer: FC<AnswerProps> = ({
maxSize={containerWidth - contentWidth - 4}
contentWidth={contentWidth}
item={item}
isLast={isLast}
question={question}
index={index}
showPromptLog={showPromptLog}
......@@ -188,37 +191,6 @@ const Answer: FC<AnswerProps> = ({
showHitInfo={config?.supportCitationHitInfo}
/>
)}
{item.siblingCount &&
item.siblingCount > 1 &&
item.siblingIndex !== undefined && (
<div className="flex items-center justify-center pt-3.5 text-sm">
<button
className={`${
item.prevSibling ? "opacity-100" : "opacity-30"
}`}
disabled={!item.prevSibling}
onClick={() =>
item.prevSibling && switchSibling?.(item.prevSibling)
}
>
<ChevronRight className="h-[14px] w-[14px] rotate-180 text-text-primary" />
</button>
<span className="px-2 text-xs text-text-primary">
{item.siblingIndex + 1} / {item.siblingCount}
</span>
<button
className={`${
item.nextSibling ? "opacity-100" : "opacity-30"
}`}
disabled={!item.nextSibling}
onClick={() =>
item.nextSibling && switchSibling?.(item.nextSibling)
}
>
<ChevronRight className="h-[14px] w-[14px] text-text-primary" />
</button>
</div>
)}
</div>
</div>
<More more={more} />
......
......@@ -26,12 +26,14 @@ type OperationProps = {
index: number;
showPromptLog?: boolean;
maxSize: number;
isLast?: boolean;
contentWidth: number;
hasWorkflowProcess: boolean;
noChatInput?: boolean;
};
const Operation: FC<OperationProps> = ({
item,
isLast,
question,
index,
showPromptLog,
......@@ -75,6 +77,10 @@ const Operation: FC<OperationProps> = ({
await onFeedback?.(id, { rating });
setLocalFeedback({ rating });
Toast.notify({
type: "success",
message: "成功",
});
};
const operationWidth = useMemo(() => {
......@@ -151,13 +157,13 @@ const Operation: FC<OperationProps> = ({
copy(content);
Toast.notify({
type: "success",
message: t("common.actionMsg.copySuccessfully"),
message: "复制成功",
});
}}
>
<RiClipboardLine className="h-4 w-4" />
</ActionButton>
{!noChatInput && (
{!noChatInput && isLast&& (
<ActionButton onClick={() => onRegenerate?.(item)}>
<RiResetLeftLine className="h-4 w-4" />
</ActionButton>
......
......@@ -271,6 +271,7 @@ const Chat: FC<ChatProps> = ({
{chatList.map((item, index) => {
if (item.isAnswer) {
const isLast = item.id === chatList[chatList.length - 1]?.id;
return (
<Answer
appData={appData}
......@@ -280,6 +281,7 @@ const Chat: FC<ChatProps> = ({
index={index}
config={config}
answerIcon={answerIcon}
isLast={isLast}
responding={isLast && isResponding}
showPromptLog={showPromptLog}
chatAnswerContainerInner={chatAnswerContainerInner}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!