<commit_before>//  Package imports.
import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { defineMessages, injectIntl } from 'react-intl';

//  Mastodon imports.
import IconButton from './icon_button';
import VisibilityIcon from './status_visibility_icon';

//  Messages for use with internationalization stuff.
const messages = defineMessages({
  collapse: { id: 'status.collapse', defaultMessage: 'Collapse' },
  uncollapse: { id: 'status.uncollapse', defaultMessage: 'Uncollapse' },
});

@injectIntl
export default class StatusIcons extends React.PureComponent {

  static propTypes = {
    status: ImmutablePropTypes.map.isRequired,
    mediaIcon: PropTypes.string,
    collapsible: PropTypes.bool,
    collapsed: PropTypes.bool,
    setCollapsed: PropTypes.func.isRequired,
    intl: PropTypes.object.isRequired,
  };

  //  Handles clicks on collapsed button
  handleCollapsedClick = (e) => {
    const { collapsed, setCollapsed } = this.props;
    if (e.button === 0) {
      setCollapsed(!collapsed);
      e.preventDefault();
    }
  }

  //  Rendering.
  render () {
    const {
      status,
      mediaIcon,
      collapsible,
      collapsed,
      intl,
    } = this.props;

    return (
      <div className='status__info__icons'>
        {mediaIcon ? (
          <i
            className={`fa fa-fw fa-${mediaIcon}`}
            aria-hidden='true'
          />
        ) : null}
        {(
          <VisibilityIcon visibility={status.get('visibility')} />
        )}
        {collapsible ? (
          <IconButton
            className='status__collapse-button'
            animate flip
            active={collapsed}
            title={<commit_msg>Add an extra icon to indicate that a status is part of a conversation<commit_after>//  Package imports.
import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { defineMessages, injectIntl } from 'react-intl';

//  Mastodon imports.
import IconButton from './icon_button';
import VisibilityIcon from './status_visibility_icon';

//  Messages for use with internationalization stuff.
const messages = defineMessages({
  collapse: { id: 'status.collapse', defaultMessage: 'Collapse' },
  uncollapse: { id: 'status.uncollapse', defaultMessage: 'Uncollapse' },
});

@injectIntl
export default class StatusIcons extends React.PureComponent {

  static propTypes = {
    status: ImmutablePropTypes.map.isRequired,
    mediaIcon: PropTypes.string,
    collapsible: PropTypes.bool,
    collapsed: PropTypes.bool,
    setCollapsed: PropTypes.func.isRequired,
    intl: PropTypes.object.isRequired,
  };

  //  Handles clicks on collapsed button
  handleCollapsedClick = (e) => {
    const { collapsed, setCollapsed } = this.props;
    if (e.button === 0) {
      setCollapsed(!collapsed);
      e.preventDefault();
    }
  }

  //  Rendering.
  render () {
    const {
      status,
      mediaIcon,
      collapsible,
      collapsed,
      intl,
    } = this.props;

    return (
      <div className='status__info__icons'>
        {status.get('in_reply_to_id', null) !== null ? (
          <i
            className={`fa fa-fw fa-comment`}
            aria-hidden='true'
          />
        ) : null}
        {mediaIcon ? (
          <i
            className={`fa fa-fw fa-${mediaIcon}`}
            aria-hidden='true'
          />
        ) : null}
        {(
          <VisibilityIcon visibility={status.get('visibility')} />
        )}
        {collapsible ? (
          <IconButton
            className='status__collapse-button'
            animate flip
            active={collapsed}
            title={
{'fraction_non_alphanumeric': 0.11693548387096774, 'fraction_numerical': 0.0005376344086021505, 'mean_word_length': 2.5438095238095237, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, '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': '5933253', 'n_tokens_mistral': 1082, 'n_tokens_neox': 1073, 'n_words': 249}