You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 Button from '@/app/components/base/button'
  6. import Divider from '@/app/components/base/divider'
  7. import cn from '@/utils/classnames'
  8. type TryToAskProps = {
  9. suggestedQuestions: string[]
  10. onSend: OnSend
  11. isMobile?: boolean
  12. }
  13. const TryToAsk: FC<TryToAskProps> = ({
  14. suggestedQuestions,
  15. onSend,
  16. isMobile,
  17. }) => {
  18. const { t } = useTranslation()
  19. return (
  20. <div className='mb-2 py-2'>
  21. <div className={cn('mb-2.5 flex items-center justify-between gap-2', isMobile && 'justify-end')}>
  22. <Divider bgStyle='gradient' className='h-px grow rotate-180' />
  23. <div className='system-xs-medium-uppercase shrink-0 text-text-tertiary'>{t('appDebug.feature.suggestedQuestionsAfterAnswer.tryToAsk')}</div>
  24. {!isMobile && <Divider bgStyle='gradient' className='h-px grow' />}
  25. </div>
  26. <div className={cn('flex flex-wrap justify-center', isMobile && 'justify-end')}>
  27. {
  28. suggestedQuestions.map((suggestQuestion, index) => (
  29. <Button
  30. size='small'
  31. key={index}
  32. variant='secondary-accent'
  33. className='mb-1 mr-1 last:mr-0'
  34. onClick={() => onSend(suggestQuestion)}
  35. >
  36. {suggestQuestion}
  37. </Button>
  38. ))
  39. }
  40. </div>
  41. </div>
  42. )
  43. }
  44. export default memo(TryToAsk)