Co-authored-by: Joel <iamjoel007@gmail.com> Co-authored-by: Yeuoly <admin@srmxy.cn> Co-authored-by: JzoNg <jzongcode@gmail.com> Co-authored-by: StyleZhang <jasonapring2015@outlook.com> Co-authored-by: jyong <jyong@dify.ai> Co-authored-by: nite-knite <nkCoding@gmail.com> Co-authored-by: jyong <718720800@qq.com>
24 lines
560 B
TypeScript
24 lines
560 B
TypeScript
import type { FC } from 'react'
|
|
import { memo } from 'react'
|
|
import type { ChatItem } from '../../types'
|
|
import { Markdown } from '@/app/components/base/markdown'
|
|
|
|
type BasicContentProps = {
|
|
item: ChatItem
|
|
}
|
|
const BasicContent: FC<BasicContentProps> = ({
|
|
item,
|
|
}) => {
|
|
const {
|
|
annotation,
|
|
content,
|
|
} = item
|
|
|
|
if (annotation?.logAnnotation)
|
|
return <Markdown content={annotation?.logAnnotation.content || ''} />
|
|
|
|
return <Markdown content={content} className={`${item.isError && '!text-[#F04438]'}`} />
|
|
}
|
|
|
|
export default memo(BasicContent)
|