import React, { FC, } from 'react'; import { useTranslation } from 'react-i18next'; import { DevidedPagePath } from '@growi/core'; import { useCurrentPagePath } from '~/stores/context'; import PageListItem from './Page/PageListItem'; type IdenticalPathAlertProps = { path? : string | null, } const IdenticalPathAlert : FC = (props: IdenticalPathAlertProps) => { const { path } = props; const { t } = useTranslation(); let _path = '――'; let _pageName = '――'; if (path != null) { const devidedPath = new DevidedPagePath(path); _path = devidedPath.isFormerRoot ? '/' : devidedPath.former; _pageName = devidedPath.latter; } return (
{t('duplicated_page_alert.same_page_name_exists', { pageName: _pageName })}

{t('duplicated_page_alert.same_page_name_exists_at_path', { path: _path, pageName: _pageName })}

{t('duplicated_page_alert.select_page_to_see')}

); }; type IdenticalPathPageProps= { // add props and types here } const jsonNull = 'null'; const IdenticalPathPage:FC = (props: IdenticalPathPageProps) => { const identicalPageDocument = document.getElementById('identical-path-page'); const pageDataList = JSON.parse(identicalPageDocument?.getAttribute('data-identical-page-data-list') || jsonNull); const shortbodyMap = JSON.parse(identicalPageDocument?.getAttribute('data-shortody-map') || jsonNull); const { data: currentPath } = useCurrentPagePath(); return (
{/* */}
    {pageDataList.map((data) => { return ( ); })}
); }; export default IdenticalPathPage;