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.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. 'use client'
  2. import { useTranslation } from 'react-i18next'
  3. import { RiCloseLine } from '@remixicon/react'
  4. import cn from '@/utils/classnames'
  5. import Button from '@/app/components/base/button'
  6. import Modal from '@/app/components/base/modal'
  7. import { AlertTriangle } from '@/app/components/base/icons/src/vender/solid/alertsAndFeedback'
  8. import { noop } from 'lodash-es'
  9. type ConfirmModalProps = {
  10. show: boolean
  11. onConfirm?: () => void
  12. onClose: () => void
  13. }
  14. const ConfirmModal = ({ show, onConfirm, onClose }: ConfirmModalProps) => {
  15. const { t } = useTranslation()
  16. return (
  17. <Modal
  18. className={cn('w-[600px] max-w-[600px] p-8')}
  19. isShow={show}
  20. onClose={noop}
  21. >
  22. <div className='absolute right-4 top-4 cursor-pointer p-2' onClick={onClose}>
  23. <RiCloseLine className='h-4 w-4 text-text-tertiary' />
  24. </div>
  25. <div className='h-12 w-12 rounded-xl border-[0.5px] border-divider-regular bg-background-section p-3 shadow-xl'>
  26. <AlertTriangle className='h-6 w-6 text-[rgb(247,144,9)]' />
  27. </div>
  28. <div className='relative mt-3 text-xl font-semibold leading-[30px] text-text-primary'>{t('tools.createTool.confirmTitle')}</div>
  29. <div className='my-1 text-sm leading-5 text-text-tertiary'>
  30. {t('tools.createTool.confirmTip')}
  31. </div>
  32. <div className='flex items-center justify-end pt-6'>
  33. <div className='flex items-center'>
  34. <Button className='mr-2' onClick={onClose}>{t('common.operation.cancel')}</Button>
  35. <Button variant="warning" onClick={onConfirm}>{t('common.operation.confirm')}</Button>
  36. </div>
  37. </div>
  38. </Modal>
  39. )
  40. }
  41. export default ConfirmModal