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