2024-01-25 12:36:55 +08:00
|
|
|
import type { FC } from 'react'
|
2024-02-07 21:23:47 +08:00
|
|
|
import { memo } from 'react'
|
2024-01-25 12:36:55 +08:00
|
|
|
import type { ChatItem } from '../../types'
|
|
|
|
|
import { Markdown } from '@/app/components/base/markdown'
|
2024-10-21 10:32:37 +08:00
|
|
|
import cn from '@/utils/classnames'
|
2024-01-25 12:36:55 +08:00
|
|
|
|
2025-03-21 17:41:03 +08:00
|
|
|
type BasicContentProps = {
|
2024-01-25 12:36:55 +08:00
|
|
|
item: ChatItem
|
|
|
|
|
}
|
|
|
|
|
const BasicContent: FC<BasicContentProps> = ({
|
|
|
|
|
item,
|
|
|
|
|
}) => {
|
|
|
|
|
const {
|
|
|
|
|
annotation,
|
|
|
|
|
content,
|
|
|
|
|
} = item
|
|
|
|
|
|
|
|
|
|
if (annotation?.logAnnotation)
|
2024-10-23 10:19:15 +08:00
|
|
|
return <Markdown content={annotation?.logAnnotation.content || ''} />
|
2024-01-25 12:36:55 +08:00
|
|
|
|
2024-10-21 10:32:37 +08:00
|
|
|
return (
|
|
|
|
|
<Markdown
|
|
|
|
|
className={cn(
|
|
|
|
|
item.isError && '!text-[#F04438]',
|
|
|
|
|
)}
|
|
|
|
|
content={content}
|
|
|
|
|
/>
|
|
|
|
|
)
|
2024-01-25 12:36:55 +08:00
|
|
|
}
|
|
|
|
|
|
2024-02-07 21:23:47 +08:00
|
|
|
export default memo(BasicContent)
|