import React, { FC } from 'react'; import { DevidedPagePath } from '@growi/core'; import { useTranslation } from 'react-i18next'; type DuplicatePageAlertProps = { path : string, } const DuplicatePageAlert : FC = (props: DuplicatePageAlertProps) => { const { path } = props; const { t } = useTranslation(); const devidedPath = new DevidedPagePath(path); return (
{t('duplicated_page_alert.same_page_name_exists', { pageName: devidedPath.latter })}

{t('duplicated_page_alert.same_page_name_exists_at_path', { path: devidedPath.isFormerRoot ? '/' : devidedPath.former, pageName: devidedPath.latter })}

{t('duplicated_page_alert.select_page_to_see')}

); };