import React from 'react'; import { pagePathUtils } from '@growi/core'; import { useTranslation } from 'next-i18next'; import PropTypes from 'prop-types'; const { convertToNewAffiliationPath } = pagePathUtils; function DuplicatedPathsTable(props) { const { t } = useTranslation(); const { fromPath, toPath, existingPaths, } = props; return ( {existingPaths.map((existPath) => { const convertedPath = convertToNewAffiliationPath(toPath, fromPath, existPath); return ( ); })}
{t('original_path')} {t('duplicated_path')}
{convertedPath} {existPath}
); } DuplicatedPathsTable.propTypes = { existingPaths: PropTypes.array.isRequired, fromPath: PropTypes.string.isRequired, toPath: PropTypes.string.isRequired, }; export default DuplicatedPathsTable;