import React, { FC, memo } from 'react'; import { useTranslation } from 'next-i18next'; import { useCurrentPagePath, useCurrentPageId, useTargetAndAncestors, useIsGuestUser, } from '~/stores/context'; import { useSWRxV5MigrationStatus } from '~/stores/page-listing'; import ItemsTree from './PageTree/ItemsTree'; import { PrivateLegacyPagesLink } from './PageTree/PrivateLegacyPagesLink'; const PageTree: FC = memo(() => { const { t } = useTranslation(); const { data: isGuestUser } = useIsGuestUser(); const { data: currentPath } = useCurrentPagePath(); const { data: targetId } = useCurrentPageId(); const { data: targetAndAncestorsData } = useTargetAndAncestors(); const { data: migrationStatus } = useSWRxV5MigrationStatus(); const targetPathOrId = targetId || currentPath; if (migrationStatus == null) { return ( <>