fix(web): copy button visible at chat page normally (#4005)

Co-authored-by: rongjun.qiu <qiurj@hengtonggroup.com.cn>
This commit is contained in:
Rhon Joe 2024-04-30 14:55:57 +08:00 committed by GitHub
parent 1d3f1d88ef
commit 0704fe9695
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 3 deletions

View File

@ -362,7 +362,7 @@ const Answer: FC<IAnswerProps> = ({
{!item.isOpeningStatement && ( {!item.isOpeningStatement && (
<CopyBtn <CopyBtn
value={content} value={content}
className={cn(s.copyBtn, 'mr-1')} className='mr-1'
/> />
)} )}
{((isShowPromptLog && !isResponding) || (!item.isOpeningStatement && isShowTextToSpeech)) && ( {((isShowPromptLog && !isResponding) || (!item.isOpeningStatement && isShowTextToSpeech)) && (

View File

@ -12,7 +12,6 @@ import cn from 'classnames'
import CopyBtn from '@/app/components/app/chat/copy-btn' import CopyBtn from '@/app/components/app/chat/copy-btn'
import SVGBtn from '@/app/components/app/chat/svg' import SVGBtn from '@/app/components/app/chat/svg'
import Flowchart from '@/app/components/app/chat/mermaid' import Flowchart from '@/app/components/app/chat/mermaid'
import s from '@/app/components/app/chat/style.module.css'
// Available language https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_HLJS.MD // Available language https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_HLJS.MD
const capitalizationLanguageNameMap: Record<string, string> = { const capitalizationLanguageNameMap: Record<string, string> = {
@ -113,7 +112,7 @@ export function Markdown(props: { content: string; className?: string }) {
/> />
} }
<CopyBtn <CopyBtn
className={cn(s.copyBtn, 'mr-1')} className='mr-1'
value={String(children).replace(/\n$/, '')} value={String(children).replace(/\n$/, '')}
isPlain isPlain
/> />