<commit_before>import React from 'react';
import PropTypes from 'prop-types';
import itsSet from 'its-set';

import { replaceLabelIfValueEmpty } from '../../utilities/chart';
import LegendShape from './LegendShape';
import './Tooltip.scss';

const Tooltip = ({ items, ...rest }) => (items.length ? (
  <div className="tooltip" style={{ position: 'absolute', ...rest }}>
    <ul>
      {items.map(({ color, key, value }, i) => {
        const hasKey = Boolean(itsSet(key) && key.length);
        return (
          <li key={replaceLabelIfValueEmpty(key)}>
            {color && <LegendShape isActive={false} fill={color} />}
            {hasKey && <span className="key">{key}</span>}
            {(itsSet(value) && hasKey) && ': '}
            {itsSet(value) && `${value}`}
          </li>
        );
      })}
    </ul>
  </div>
) : null);
<commit_msg>#1867 fixed linting<commit_after>import React from 'react';
import PropTypes from 'prop-types';
import itsSet from 'its-set';

import { replaceLabelIfValueEmpty } from '../../utilities/chart';
import LegendShape from './LegendShape';
import './Tooltip.scss';

const Tooltip = ({ items, ...rest }) => (items.length ? (
  <div className="tooltip" style={{ position: 'absolute', ...rest }}>
    <ul>
      {items.map(({ color, key, value }) => {
        const hasKey = Boolean(itsSet(key) && key.length);
        return (
          <li key={replaceLabelIfValueEmpty(key)}>
            {color && <LegendShape isActive={false} fill={color} />}
            {hasKey && <span className="key">{key}</span>}
            {(itsSet(value) && hasKey) && ': '}
            {itsSet(value) && `${value}`}
          </li>
        );
      })}
    </ul>
  </div>
) : null);

{'fraction_non_alphanumeric': 0.19917984768599883, 'fraction_numerical': 0.0023432923257176333, 'mean_word_length': 2.6340425531914895, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 25, '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': '4769301', 'n_tokens_mistral': 533, 'n_tokens_neox': 536, 'n_words': 123}