import React from 'react'; import { connect } from 'react-redux'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import Icon from 'soapbox/components/icon'; import IconWithCounter from 'soapbox/components/icon_with_counter'; import { NavLink } from 'react-router-dom'; import { FormattedMessage } from 'react-intl'; const mapStateToProps = (state, props) => ({ instance: state.get('instance'), approvalCount: state.getIn(['admin', 'awaitingApproval']).count(), reportsCount: state.getIn(['admin', 'openReports']).count(), }); export default @connect(mapStateToProps) class AdminNav extends React.PureComponent { static propTypes = { instance: ImmutablePropTypes.map.isRequired, approvalCount: PropTypes.number, reportsCount: PropTypes.number, }; render() { const { instance, approvalCount, reportsCount } = this.props; return ( <>