Commit ff4515aa by HoMeTown

feat: 回答的operate调整

parent 2e98e73c
......@@ -39,7 +39,9 @@ export const ChatAnswerAttachment: React.FC<ChatAnswerAttachmentProps> = ({ from
}
return (
<div className="attachmentList flex flex-col gap-[20px]">
{answer.attachmentList && answer.attachmentList.map((attachment, index) => (
{answer.attachmentList && answer.attachmentList.map((attachment, index) => {
if (attachment?.type) {
return (
<div key={`${attachment.type}_${index}`}>
{/* 附件:product-detail */}
{attachment.type === 'product-detail' && (
......@@ -111,7 +113,10 @@ export const ChatAnswerAttachment: React.FC<ChatAnswerAttachmentProps> = ({ from
)
}
</div>
))}
)
}
return null
})}
</div>
)
}
......@@ -124,7 +124,7 @@ export const ChatAnswerParser: React.FC<ChatAnswerParserProps> = ({ isLastAnswer
}, [isStopTyping])
useEffect(() => {
setHideOperate((answer.attachmentList || []).some(attachment => attachment.type === 'box'))
setHideOperate((answer.attachmentList || []).some(attachment => attachment?.type === 'box' || attachment?.type?.includes('card-')))
}, [answer.attachmentList])
return (
......
......@@ -11,7 +11,7 @@ interface ChatAnswerShowerProps {
}
export const ChatAnswerShower: React.FC<ChatAnswerShowerProps> = ({ answer, isLastAnswer, onSubmitQuestion }) => {
const hideOperate = (answer.attachmentList || []).some(attachment => attachment.type === 'box')
const hideOperate = (answer.attachmentList || []).some(attachment => attachment.type === 'box' || attachment?.type?.includes('card-'))
return (
<div className="answerShower">
{answer.answer && (
......@@ -22,6 +22,7 @@ export const ChatAnswerShower: React.FC<ChatAnswerShowerProps> = ({ answer, isLa
</div>
)}
{answer.attachmentList && answer.attachmentList?.length !== 0 && <ChatAnswerAttachment onSubmitQuestion={onSubmitQuestion} isLastAnswer={isLastAnswer} answer={answer} />}
{/* {} */}
{!hideOperate && <ChatAnswerOperate answer={answer} />}
</div>
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment