mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-04 22:35:51 -05:00
92eade7502
[web] BS5 pdf toolbar GitOrigin-RevId: a04091c9e936e52f47c3977b3149ffe613d43bb9
22 lines
669 B
JavaScript
22 lines
669 B
JavaScript
import { useTranslation } from 'react-i18next'
|
|
import { memo, useCallback } from 'react'
|
|
import { buildUrlWithDetachRole } from '@/shared/utils/url-helper'
|
|
import { useLocation } from '@/shared/hooks/use-location'
|
|
import OLButton from '@/features/ui/components/ol/ol-button'
|
|
|
|
function PdfOrphanRefreshButton() {
|
|
const { t } = useTranslation()
|
|
const location = useLocation()
|
|
|
|
const redirect = useCallback(() => {
|
|
location.assign(buildUrlWithDetachRole(null).toString())
|
|
}, [location])
|
|
|
|
return (
|
|
<OLButton variant="primary" size="sm" onClick={redirect}>
|
|
{t('redirect_to_editor')}
|
|
</OLButton>
|
|
)
|
|
}
|
|
|
|
export default memo(PdfOrphanRefreshButton)
|