mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2025-07-29 05:00:06 +02:00

Convert PDF Preview components to typescript GitOrigin-RevId: 34594d21143727fa42b8b595aa12125a4dd7ae5e
22 lines
669 B
TypeScript
22 lines
669 B
TypeScript
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)
|