DuplicatePage.tsx 999 B

1234567891011121314151617181920212223242526
  1. import React, { FC } from 'react';
  2. import { DevidedPagePath } from '@growi/core';
  3. import { useTranslation } from 'react-i18next';
  4. type DuplicatePageAlertProps = {
  5. path : string,
  6. }
  7. const DuplicatePageAlert : FC<DuplicatePageAlertProps> = (props: DuplicatePageAlertProps) => {
  8. const { path } = props;
  9. const { t } = useTranslation();
  10. const devidedPath = new DevidedPagePath(path);
  11. return (
  12. <div className="alert alert-warning py-3">
  13. <h5 className="font-weight-bold mt-1">{t('duplicated_page_alert.same_page_name_exists', { pageName: devidedPath.latter })}</h5>
  14. <p>
  15. {t('duplicated_page_alert.same_page_name_exists_at_path',
  16. { path: devidedPath.isFormerRoot ? '/' : devidedPath.former, pageName: devidedPath.latter })}<br />
  17. <p dangerouslySetInnerHTML={{ __html: t('See_more_detail_on_new_schema', { url: t('GROWI.5.0_new_schema') }) }} />
  18. </p>
  19. <p className="mb-1">{t('duplicated_page_alert.select_page_to_see')}</p>
  20. </div>
  21. );
  22. };