mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
d50271c1e9
[DeleteAccount] Create Modal with Form GitOrigin-RevId: 611f08c7253f59d91c6937b79c80a386b9d21ccd
29 lines
684 B
TypeScript
29 lines
684 B
TypeScript
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')}{' '}
|
|
<button className="btn btn-inline-link" onClick={handleOpen}>
|
|
{t('delete_your_account')}
|
|
</button>
|
|
<LeaveModal isOpen={isModalOpen} handleClose={handleClose} />
|
|
</>
|
|
)
|
|
}
|
|
|
|
export default LeaveSection
|