index.tsx 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. 'use client'
  2. import { useTranslation } from 'react-i18next'
  3. import { RiCloseLine } from '@remixicon/react'
  4. import s from './style.module.css'
  5. import cn from '@/utils/classnames'
  6. import Button from '@/app/components/base/button'
  7. import Modal from '@/app/components/base/modal'
  8. import { AlertTriangle } from '@/app/components/base/icons/src/vender/solid/alertsAndFeedback'
  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('p-8 max-w-[600px] w-[600px]', s.bg)}
  19. isShow={show}
  20. onClose={() => { }}
  21. >
  22. <div className='absolute right-4 top-4 p-2 cursor-pointer' onClick={onClose}>
  23. <RiCloseLine className='w-4 h-4 text-gray-500' />
  24. </div>
  25. <div className='w-12 h-12 p-3 bg-white rounded-xl border-[0.5px] border-gray-100 shadow-xl'>
  26. <AlertTriangle className='w-6 h-6 text-[rgb(247,144,9)]' />
  27. </div>
  28. <div className='relative mt-3 text-xl font-semibold leading-[30px] text-gray-900'>{t('tools.createTool.confirmTitle')}</div>
  29. <div className='my-1 text-gray-500 text-sm leading-5'>
  30. {t('tools.createTool.confirmTip')}
  31. </div>
  32. <div className='pt-6 flex justify-end items-center'>
  33. <div className='flex items-center'>
  34. <Button className='mr-2' onClick={onClose}>{t('common.operation.cancel')}</Button>
  35. <Button className='border-red-700' variant="warning" onClick={onConfirm}>{t('common.operation.confirm')}</Button>
  36. </div>
  37. </div>
  38. </Modal>
  39. )
  40. }
  41. export default ConfirmModal