import React from 'react' import PropTypes from 'prop-types' import { connect } from 'react-redux' import { defineMessages, injectIntl } from 'react-intl' import ImmutablePureComponent from 'react-immutable-pure-component' import ImmutablePropTypes from 'react-immutable-proptypes' import moment from 'moment-mini' import { shortNumberFormat } from '../../utils/numbers' import PanelLayout from './panel_layout' import Button from '../button' import Divider from '../divider' import Heading from '../heading' import Icon from '../icon' import Text from '../text' import DotTextSeperator from '../dot_text_seperator' import ProfileInfoPanelPlaceholder from '../placeholder/profile_info_panel_placeholder' const messages = defineMessages({ title: { id: 'about', defaultMessage: 'About' }, members: { id: 'members', defaultMessage: 'Members' }, created: { id: 'created', defaultMessage: 'Created' }, category: { id: 'category', defaultMessage: 'Category' }, tags: { id: 'tags', defaultMessage: 'Tags' }, privateGroup: { id: 'group.private', defaultMessage: 'Private' }, publicGroup: { id: 'group.public', defaultMessage: 'Public' }, visibleGroup: { id: 'group.visible', defaultMessage: 'Visible' }, invisibleGroup: { id: 'group.invisible', defaultMessage: 'Invisible' }, }) const mapStateToProps = (state, { group }) => { const groupId = group ? group.get('id') : -1 const relationships = group === -1 ? null : state.getIn(['group_relationships', groupId]) return { relationships } } export default @injectIntl @connect(mapStateToProps) class GroupInfoPanel extends ImmutablePureComponent { static propTypes = { group: ImmutablePropTypes.map.isRequired, intl: PropTypes.object.isRequired, noPanel: PropTypes.bool, relationships: ImmutablePropTypes.map, } render() { const { intl, group, noPanel, relationships, } = this.props if (!group && !noPanel) { return (