2021-11-15 11:33:57 -05:00
|
|
|
import { Button } from 'react-bootstrap'
|
|
|
|
import { useTranslation } from 'react-i18next'
|
2023-03-16 08:32:48 -04:00
|
|
|
import { memo, useCallback } from 'react'
|
2021-11-15 11:33:57 -05:00
|
|
|
import { buildUrlWithDetachRole } from '../../../shared/utils/url-helper'
|
2023-03-16 08:32:48 -04:00
|
|
|
import { useLocation } from '../../../shared/hooks/use-location'
|
2021-11-15 11:33:57 -05:00
|
|
|
|
|
|
|
function PdfOrphanRefreshButton() {
|
|
|
|
const { t } = useTranslation()
|
2023-03-16 08:32:48 -04:00
|
|
|
const location = useLocation()
|
|
|
|
|
|
|
|
const redirect = useCallback(() => {
|
|
|
|
location.assign(buildUrlWithDetachRole(null).toString())
|
|
|
|
}, [location])
|
2021-11-15 11:33:57 -05:00
|
|
|
|
|
|
|
return (
|
|
|
|
<Button
|
|
|
|
onClick={redirect}
|
|
|
|
className="btn-orphan"
|
|
|
|
bsStyle="primary"
|
|
|
|
bsSize="small"
|
|
|
|
>
|
|
|
|
{t('redirect_to_editor')}
|
|
|
|
</Button>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default memo(PdfOrphanRefreshButton)
|