DuplicatedAlert.jsx 660 B

123456789101112131415161718192021222324
  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import { withTranslation } from 'react-i18next';
  4. const DuplicatedAlert = (props) => {
  5. const { t } = props;
  6. const urlParams = new URLSearchParams(window.location.search);
  7. const fromPath = urlParams.get('duplicated');
  8. return (
  9. <div className="alert alert-success py-3 px-4">
  10. <strong>
  11. { t('Duplicated') }: {t('page_page.notice.duplicated')} <code>{fromPath}</code> {t('page_page.notice.duplicated_period')}
  12. </strong>
  13. </div>
  14. );
  15. };
  16. DuplicatedAlert.propTypes = {
  17. t: PropTypes.func.isRequired, // i18next
  18. };
  19. export default withTranslation()(DuplicatedAlert);