content.tsx 910 B

12345678910111213141516171819202122232425262728293031323334
  1. import type { FC } from 'react'
  2. import React from 'react'
  3. import Header from './header'
  4. import type { FeedbackType } from '@/app/components/base/chat/chat/type'
  5. import { format } from '@/service/base'
  6. export type IResultProps = {
  7. content: string
  8. showFeedback: boolean
  9. feedback: FeedbackType
  10. onFeedback: (feedback: FeedbackType) => void
  11. }
  12. const Result: FC<IResultProps> = ({
  13. content,
  14. showFeedback,
  15. feedback,
  16. onFeedback,
  17. }) => {
  18. return (
  19. <div className='basis-3/4 h-max'>
  20. <Header result={content} showFeedback={showFeedback} feedback={feedback} onFeedback={onFeedback} />
  21. <div
  22. className='mt-4 w-full flex text-sm leading-5 overflow-scroll font-normal text-gray-900'
  23. style={{
  24. maxHeight: '70vh',
  25. }}
  26. dangerouslySetInnerHTML={{
  27. __html: format(content),
  28. }}
  29. ></div>
  30. </div>
  31. )
  32. }
  33. export default React.memo(Result)