leave-project-modal.tsx 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import OLButton from '@/features/ui/components/ol/ol-button'
  2. import OLModal, {
  3. OLModalBody,
  4. OLModalFooter,
  5. OLModalHeader,
  6. OLModalTitle,
  7. } from '@/features/ui/components/ol/ol-modal'
  8. import Notification from '@/shared/components/notification'
  9. import { useTranslation } from 'react-i18next'
  10. type LeaveProjectModalProps = {
  11. showModal: boolean
  12. handleCloseModal: () => void
  13. handleLeaveAction: () => void
  14. }
  15. function LeaveProjectModal({
  16. showModal,
  17. handleCloseModal,
  18. handleLeaveAction,
  19. }: LeaveProjectModalProps) {
  20. const { t } = useTranslation()
  21. return (
  22. <OLModal
  23. animation
  24. show={showModal}
  25. onHide={handleCloseModal}
  26. id="action-project-modal"
  27. backdrop="static"
  28. >
  29. <OLModalHeader closeButton>
  30. <OLModalTitle>{t('leave_project')}</OLModalTitle>
  31. </OLModalHeader>
  32. <OLModalBody>
  33. <p>{t('about_to_leave_project')}</p>
  34. <Notification
  35. content={t('this_action_cannot_be_undone')}
  36. type="warning"
  37. />
  38. </OLModalBody>
  39. <OLModalFooter>
  40. <OLButton variant="secondary" onClick={handleCloseModal}>
  41. {t('cancel')}
  42. </OLButton>
  43. <OLButton variant="danger" onClick={() => handleLeaveAction()}>
  44. {t('confirm')}
  45. </OLButton>
  46. </OLModalFooter>
  47. </OLModal>
  48. )
  49. }
  50. export default LeaveProjectModal