try-to-ask.tsx 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. variant='secondary-accent'
  42. className='mb-2 mr-2 last:mr-0'
  43. onClick={() => onSend(suggestQuestion)}
  44. >
  45. {suggestQuestion}
  46. </Button>
  47. ))
  48. }
  49. </div>
  50. </div>
  51. )
  52. }
  53. export default memo(TryToAsk)