try-to-ask.tsx 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import type { FC } from 'react'
  2. import { memo } from 'react'
  3. import { useTranslation } from 'react-i18next'
  4. import type { OnSend } from '../types'
  5. import { Star04 } from '@/app/components/base/icons/src/vender/solid/shapes'
  6. import Button from '@/app/components/base/button'
  7. type TryToAskProps = {
  8. suggestedQuestions: string[]
  9. onSend: OnSend
  10. }
  11. const TryToAsk: FC<TryToAskProps> = ({
  12. suggestedQuestions,
  13. onSend,
  14. }) => {
  15. const { t } = useTranslation()
  16. return (
  17. <div>
  18. <div className='flex items-center mb-2.5 py-2'>
  19. <div
  20. className='grow h-[1px]'
  21. style={{
  22. background: 'linear-gradient(270deg, #F3F4F6 0%, rgba(243, 244, 246, 0) 100%)',
  23. }}
  24. />
  25. <div className='shrink-0 flex items-center px-3 text-gray-500'>
  26. <Star04 className='mr-1 w-2.5 h-2.5' />
  27. <span className='text-xs text-gray-500 font-medium'>{t('appDebug.feature.suggestedQuestionsAfterAnswer.tryToAsk')}</span>
  28. </div>
  29. <div
  30. className='grow h-[1px]'
  31. style={{
  32. background: 'linear-gradient(270deg, rgba(243, 244, 246, 0) 0%, #F3F4F6 100%)',
  33. }}
  34. />
  35. </div>
  36. <div className='flex flex-wrap justify-center'>
  37. {
  38. suggestedQuestions.map((suggestQuestion, index) => (
  39. <Button
  40. key={index}
  41. className='mb-2 mr-2 last:mr-0 px-3 py-[5px] bg-white text-primary-600 text-xs font-medium'
  42. onClick={() => onSend(suggestQuestion)}
  43. >
  44. {suggestQuestion}
  45. </Button>
  46. ))
  47. }
  48. </div>
  49. </div>
  50. )
  51. }
  52. export default memo(TryToAsk)