import React, { useCallback } from 'react'; import { useTranslation } from 'react-i18next'; import { UncontrolledTooltip } from 'reactstrap'; import { EditorMode, useEditorMode } from '~/stores/ui'; type Props = { isGuestUserMode?: boolean, } const NotFoundAlert = (props: Props): JSX.Element => { const { t } = useTranslation(); const { isGuestUserMode } = props; const { data: editorMode, mutate: mutateEditorMode } = useEditorMode(); const isEditorMode = editorMode !== EditorMode.View; const clickHandler = useCallback(() => { // check guest user, // disabled of button cannot be used for using tooltip. if (isGuestUserMode) { return; } mutateEditorMode(EditorMode.Editor); }, [isGuestUserMode, mutateEditorMode]); if (isEditorMode) { return <>; } return (

{t('not_found_page.page_not_exist_alert')}

{isGuestUserMode && ( {t('Not available for guest')} )}
); }; export default NotFoundAlert;