import React from 'react'; import PropTypes from 'prop-types'; import { withTranslation } from 'react-i18next'; import { pagePathUtils } from '@growi/core'; const { convertToNewAffiliationPath } = pagePathUtils; function ComparePathsTable(props) { const { path, subordinatedPages, newPagePath, t, } = props; return ( {subordinatedPages.map((subordinatedPage) => { const convertedPath = convertToNewAffiliationPath(path, newPagePath, subordinatedPage.path); return ( ); })}
{t('original_path')} {t('new_path')}
{subordinatedPage.path} {convertedPath}
); } ComparePathsTable.propTypes = { t: PropTypes.func.isRequired, // i18next path: PropTypes.string.isRequired, subordinatedPages: PropTypes.array.isRequired, newPagePath: PropTypes.string.isRequired, }; export default withTranslation()(ComparePathsTable);