basic-content.tsx 560 B

1234567891011121314151617181920212223
  1. import type { FC } from 'react'
  2. import { memo } from 'react'
  3. import type { ChatItem } from '../../types'
  4. import { Markdown } from '@/app/components/base/markdown'
  5. type BasicContentProps = {
  6. item: ChatItem
  7. }
  8. const BasicContent: FC<BasicContentProps> = ({
  9. item,
  10. }) => {
  11. const {
  12. annotation,
  13. content,
  14. } = item
  15. if (annotation?.logAnnotation)
  16. return <Markdown content={annotation?.logAnnotation.content || ''} />
  17. return <Markdown content={content} className={`${item.isError && '!text-[#F04438]'}`} />
  18. }
  19. export default memo(BasicContent)