2021-11-15 11:33:57 -05:00
|
|
|
import { useTranslation } from 'react-i18next'
|
2023-03-16 08:32:48 -04:00
|
|
|
import { memo, useCallback } from 'react'
|
2024-10-08 10:22:13 -04:00
|
|
|
import { buildUrlWithDetachRole } from '@/shared/utils/url-helper'
|
|
|
|
import { useLocation } from '@/shared/hooks/use-location'
|
|
|
|
import OLButton from '@/features/ui/components/ol/ol-button'
|
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 (
|
2024-10-08 10:22:13 -04:00
|
|
|
<OLButton variant="primary" size="sm" onClick={redirect}>
|
2021-11-15 11:33:57 -05:00
|
|
|
{t('redirect_to_editor')}
|
2024-10-08 10:22:13 -04:00
|
|
|
</OLButton>
|
2021-11-15 11:33:57 -05:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default memo(PdfOrphanRefreshButton)
|