<commit_before>import React, { Component } from 'react';
import { connect } from 'react-redux';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';

import IconButton from '@/components/IconButton';

class HeaderBar extends Component {
    static propTypes = {
        group: ImmutablePropTypes.map,
        showGroupInfo: PropTypes.func,
    }
    render() {
        const { group, showGroupInfo } = this.props;
        return (
            <div className="chat-headerBar">
                <h2>{group && group.get('name')}</h2>
                <div>
                    <IconButton width={40} height={40} icon="gongneng" iconSize={24} onClick={showGroupInfo} />
                </div>
            </div>
        );
    }
}

export default connect((state) => {
    const focusGroup = state.get('focusGroup');
    const groups = state.getIn(['user', 'groups']);
    let group = null;
    if (groups) {
        group = groups.find(g => g.get('_id') === focusGroup);
    }
    return {
        group,
    };
})(HeaderBar);
<commit_msg>feat: Display contact name. Ungroup does not show group information button<commit_after>import React, { Component } from 'react';
import { connect } from 'react-redux';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import immutable from 'immutable';

import IconButton from '@/components/IconButton';

class HeaderBar extends Component {
    static propTypes = {
        linkman: ImmutablePropTypes.map,
        showGroupInfo: PropTypes.func,
    }
    render() {
        const { linkman, showGroupInfo } = this.props;
        return (
            <div className="chat-headerBar">
                <h2>{linkman && linkman.get('name')}</h2>
                <div>
                    {linkman.get('type') === 'group' ? <IconButton width={40} height={40} icon="gongneng" iconSize={24} onClick={showGroupInfo} /> : null}
                </div>
            </div>
        );
    }
}

export default connect((state) => {
    const focus = state.get('focus');
    const linkmans = state.getIn(['user', 'linkmans']) || immutable.List;
    const linkman = linkmans.find(g => g.get('_id') === focus);
    return {
        linkman,
    };
})(HeaderBar);

{'fraction_non_alphanumeric': 0.1437389770723104, 'fraction_numerical': 0.007054673721340388, 'mean_word_length': 2.573228346456693, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3624318', 'n_tokens_mistral': 670, 'n_tokens_neox': 663, 'n_words': 158}