<commit_before>import React from 'react';
import { propType } from 'graphql-anywhere';
import PropTypes from 'prop-types';
import moment from 'moment';

import emptyOrTipsFragment from 'react/pages/profile/ProfilePage/components/EmptyMessageOrComponent/fragments/emptyOrTips';

import ProfileEmptyMessage from 'react/components/ProfileEmptyMessage';
import ProfileTips from 'react/components/ProfileTips';

const EmptyMessageOrComponent = ({
  count: sectionCount,
  children,
  identifiable,
  ...rest
}) => {
  const contentCount = identifiable.counts.blocks + identifiable.counts.channels;
  const createdAtDaysAgo = moment().diff(moment(identifiable.created_at), 'days');

  const isMyProfile = identifiable.is_me;
  const isRecentAccount = createdAtDaysAgo <= 7;
  const isSectionEmpty = sectionCount === 0;
  const isProfileTotallyEmpty = contentCount === 0;

  const components = [];

  if (
    (isMyProfile && isRecentAccount && !isProfileTotallyEmpty) ||
    (isMyProfile && isProfileTotallyEmpty)
  ) {
    components.push(<ProfileTips key="profileTips" />);
  }

  if (
    (isSectionEmpty && (isMyProfile && !isProfileTotallyEmpty)) ||
    (!isMyProfile && isSectionEmpty)
  ) {
    const profileEmptyMessage = (
      <ProfileEmptyMessage
        key="profileEmptyMessage"
        isMine={isMyProfile}
        identifiable={identifiable}
        {...rest}
      />
    );
    components.push(profileEmptyMessage);
  }

  if (!isSectionEmpty) {
    components.push(children);
  }<commit_msg>Don't show tips on a group profile<commit_after>import React from 'react';
import { propType } from 'graphql-anywhere';
import PropTypes from 'prop-types';
import moment from 'moment';

import emptyOrTipsFragment from 'react/pages/profile/ProfilePage/components/EmptyMessageOrComponent/fragments/emptyOrTips';

import ProfileEmptyMessage from 'react/components/ProfileEmptyMessage';
import ProfileTips from 'react/components/ProfileTips';

const EmptyMessageOrComponent = ({
  count: sectionCount,
  children,
  identifiable,
  ...rest
}) => {
  const contentCount = identifiable.counts.blocks + identifiable.counts.channels;
  const createdAtDaysAgo = moment().diff(moment(identifiable.created_at), 'days');

  const isMyProfile = identifiable.is_me;
  const isRecentAccount = createdAtDaysAgo <= 7;
  const isSectionEmpty = sectionCount === 0;
  const isProfileTotallyEmpty = contentCount === 0;
  const isGroupProfile = identifiable.__typename === 'Group';

  const components = [];

  if (
    (isMyProfile && isRecentAccount && !isProfileTotallyEmpty && !isGroupProfile) ||
    (isMyProfile && isProfileTotallyEmpty && !isGroupProfile)
  ) {
    components.push(<ProfileTips key="profileTips" />);
  }

  if (
    (isSectionEmpty && (isMyProfile && !isProfileTotallyEmpty)) ||
    (!isMyProfile && isSectionEmpty)
  ) {
    const profileEmptyMessage = (
      <ProfileEmptyMessage
        key="profileEmptyMessage"
        isMine={isMyProfile}
        identifiable={identifiable}
        {...rest}
      />
    );
    components.push(profileEmptyMessage);
  }

  if (!isSectionEmpty) {
    components.push(children);
  }
{'fraction_non_alphanumeric': 0.11728986896772131, 'fraction_numerical': 0.0019175455417066154, 'mean_word_length': 4.341296928327645, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2407103', 'n_tokens_mistral': 938, 'n_tokens_neox': 894, 'n_words': 182}