import React from 'react'; import PropTypes from 'prop-types'; import { withTranslation } from 'react-i18next'; import { withUnstatedContainers } from './UnstatedUtils'; import AppContainer from '../services/AppContainer'; const ShareLinkList = (props) => { function deleteLinkHandler(shareLinkId) { if (props.onClickDeleteButton == null) { return; } props.onClickDeleteButton(shareLinkId); } function renderShareLinks() { return ( <> {props.shareLinks.map(shareLink => ( {shareLink.link} {shareLink.expiration} {shareLink.description} ))} ); } return (
{renderShareLinks()}
Link Expiration Description Order
); }; const ShareLinkListWrapper = withUnstatedContainers(ShareLinkList, [AppContainer]); ShareLinkList.propTypes = { t: PropTypes.func.isRequired, // i18next appContainer: PropTypes.instanceOf(AppContainer).isRequired, shareLinks: PropTypes.array.isRequired, onClickDeleteButton: PropTypes.func, }; export default withTranslation()(ShareLinkListWrapper);