mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-25 18:01:38 +00:00
b289afe23c
[SettingsPage] Misc Fixes GitOrigin-RevId: 56f58d2bb5830f7e0584a83c98efc9989ae2bd42
29 lines
695 B
TypeScript
29 lines
695 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 btn-danger" onClick={handleOpen}>
|
|
{t('delete_your_account')}
|
|
</button>
|
|
<LeaveModal isOpen={isModalOpen} handleClose={handleClose} />
|
|
</>
|
|
)
|
|
}
|
|
|
|
export default LeaveSection
|