<commit_before>// @flow
import * as ICONS from 'constants/icons';
import React from 'react';
import classnames from 'classnames';
import Button from 'component/button';

type Props = {
  name: string,
  type?: string,
  onClick?: any => any,
  disabled: boolean,
};

export default function Tag(props: Props) {
  const { name, onClick, type = 'link', disabled = false } = props;

  const clickProps = onClick ? { onClick } : { navigate: `/$/tags?t=${name}` };
  let title;
  if (!onClick) {
    title = __('View tag');
  } else {
    type === 'add' ? __('Add tag') : __('Remove tag');
  }

  return (
    <Button
      {...clickProps}
      disabled={disabled}
      title={title}
      className={classnames('tag', {
        'tag--add': type === 'add',
        'tag--remove': type === 'remove',
      })}
      label={name}
      iconSize={12}
      iconRight={type !== 'link' && (type === 'remove' ? ICONS.REMOVE : ICONS.ADD)}
    />
  );
}<commit_msg>fix typo<commit_after>// @flow
import * as ICONS from 'constants/icons';
import React from 'react';
import classnames from 'classnames';
import Button from 'component/button';

type Props = {
  name: string,
  type?: string,
  onClick?: any => any,
  disabled: boolean,
};

export default function Tag(props: Props) {
  const { name, onClick, type = 'link', disabled = false } = props;

  const clickProps = onClick ? { onClick } : { navigate: `/$/tags?t=${name}` };
  let title;
  if (!onClick) {
    title = __('View tag');
  } else {
    title = type === 'add' ? __('Add tag') : __('Remove tag');
  }

  return (
    <Button
      {...clickProps}
      disabled={disabled}
      title={title}
      className={classnames('tag', {
        'tag--add': type === 'add',
        'tag--remove': type === 'remove',
      })}
      label={name}
      iconSize={12}
      iconRight={type !== 'link' && (type === 'remove' ? ICONS.REMOVE : ICONS.ADD)}
    />
  );
}
{'fraction_non_alphanumeric': 0.18681318681318682, 'fraction_numerical': 0.0020931449502878076, 'mean_word_length': 2.8704453441295548, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '641274', 'n_tokens_mistral': 627, 'n_tokens_neox': 623, 'n_words': 168}