import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {Icon} from 'coral-ui'; import styles from './FlagBox.css'; import t from 'coral-framework/services/i18n'; const shortReasons = { 'This comment is offensive': t('modqueue.offensive'), 'This looks like an ad/marketing': t('modqueue.spam_ads'), 'This user is impersonating': t('modqueue.impersonating'), 'I don\'t like this username': t('modqueue.dont_like_username'), 'Other': t('modqueue.other') }; class FlagBox extends Component { constructor () { super(); this.state = { showDetail: false }; } toggleDetail = () => { this.setState((state) => ({ showDetail: !state.showDetail })); } reasonMap = (reason) => { const shortReason = shortReasons[reason]; // if the short reason isn't found, just return the long one. return shortReason ? shortReason : reason; } render() { const {actionSummaries, actions, viewUserDetail} = this.props; const {showDetail} = this.state; return (