import React from 'react';
import PropTypes from 'prop-types';
import { withTranslation } from 'react-i18next';
import { withUnstatedContainers } from './UnstatedUtils';
import PageContainer from '../services/PageContainer';
import { convertToNewAffiliationPath } from '../../../lib/util/path-utils';
function ComparePathsTable(props) {
const { subordinatedPages, pageContainer } = props;
const { path } = pageContainer.state;
// Dummy
const newPagePath = 'huga';
return (
{/* TODO i18n */}
| 元のパス |
新しいパス |
|
|
{subordinatedPages.map((subordinatedPage) => {
const convertedPath = convertToNewAffiliationPath(path, newPagePath, subordinatedPage.path);
return (
-
{convertedPath}
);
})}
|
);
}
/**
* Wrapper component for using unstated
*/
const PageDuplicateModallWrapper = withUnstatedContainers(ComparePathsTable, [PageContainer]);
ComparePathsTable.propTypes = {
t: PropTypes.func.isRequired, // i18next
pageContainer: PropTypes.instanceOf(PageContainer).isRequired,
subordinatedPages: PropTypes.array.isRequired,
};
export default withTranslation()(PageDuplicateModallWrapper);