2022-04-08 07:00:31 -04:00
|
|
|
import { useState, useCallback } from 'react'
|
|
|
|
import { useTranslation } from 'react-i18next'
|
|
|
|
import LeaveModal from './leave/modal'
|
|
|
|
|
|
|
|
function LeaveSection() {
|
|
|
|
const { t } = useTranslation()
|
|
|
|
|
|
|
|
const [isModalOpen, setIsModalOpen] = useState(false)
|
|
|
|
|
|
|
|
const handleClose = useCallback(() => {
|
|
|
|
setIsModalOpen(false)
|
|
|
|
}, [])
|
|
|
|
|
|
|
|
const handleOpen = useCallback(() => {
|
|
|
|
setIsModalOpen(true)
|
|
|
|
}, [])
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{t('need_to_leave')}{' '}
|
2022-04-25 07:05:15 -04:00
|
|
|
<button className="btn btn-inline-link btn-danger" onClick={handleOpen}>
|
2022-04-08 07:00:31 -04:00
|
|
|
{t('delete_your_account')}
|
|
|
|
</button>
|
|
|
|
<LeaveModal isOpen={isModalOpen} handleClose={handleClose} />
|
|
|
|
</>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default LeaveSection
|