panel.tsx 767 B

1234567891011121314151617181920212223242526272829
  1. 'use client'
  2. import type { FC } from 'react'
  3. import React from 'react'
  4. import { useTranslation } from 'react-i18next'
  5. type Props = {
  6. isRequest: boolean
  7. toolName: string
  8. content: string
  9. }
  10. const Panel: FC<Props> = ({
  11. isRequest,
  12. toolName,
  13. content,
  14. }) => {
  15. const { t } = useTranslation()
  16. return (
  17. <div className='rounded-md bg-gray-100 overflow-hidden border border-black/5'>
  18. <div className='flex items-center px-2 py-1 leading-[18px] bg-gray-50 uppercase text-xs font-medium text-gray-500'>
  19. {t(`tools.thought.${isRequest ? 'requestTitle' : 'responseTitle'}`)} {toolName}
  20. </div>
  21. <div className='p-2 border-t border-black/5 leading-4 text-xs text-gray-700'>{content}</div>
  22. </div>
  23. )
  24. }
  25. export default React.memo(Panel)