leave-project-modal.tsx 1.3 KB

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