<commit_before>import React from 'react'
import { translate } from 'react-i18next'
import PropTypes from 'prop-types'

import Check from './check'

const DistributionCheck = ({ distributions, isValid, t }) => (
  <Check title={t('datagouv.checks.distribution.title')} isValid={isValid}>
    {isValid ? (
      <div>
        {t('datagouv.checks.distribution.available')}
        {distributions.map(distribution => distribution.available ? (
          <div key={distribution._id}>
            <b>{distribution.typeName || distribution.layer || distribution.name}</b>
          </div>
        ) : null)}
      </div>
    ) : t('datagouv.checks.distribution.unavailable')}
  </Check>
)

DistributionCheck.propTypes = {
  isValid: PropTypes.bool.isRequired,
  distributions: PropTypes.arrayOf(PropTypes.shape({
    _id: PropTypes.string.isRequired,
    available: PropTypes.bool,
    typeName: PropTypes.string,
    layer: PropTypes.string,
    name: PropTypes.string
  })).isRequired,

  t: PropTypes.func.isRequired
}

export default translate('dataset')(DistributionCheck)<commit_msg>Update data distribution check style<commit_after>import React from 'react'
import { translate } from 'react-i18next'
import PropTypes from 'prop-types'

import Check from './check'

const DistributionCheck = ({ distributions, isValid, t }) => (
  <Check title={t('datagouv.checks.distribution.title')} isValid={isValid}>
    {isValid ? (
      <div>
        {t('datagouv.checks.distribution.available')}
        <ul>
          {distributions.map(distribution => distribution.available ? (
            <li key={distribution._id}>
              {distribution.typeName || distribution.layer || distribution.name}
            </li>
          ) : null)}
        </ul>
      </div>
    ) : t('datagouv.checks.distribution.unavailable')}

    <style jsx>{`
      ul {
        margin-top: 0.4em;
        margin-bottom: 0;
        padding-left: 0.8em;
      }

      li {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
      }
    `}</style>
  </Check>
)

DistributionCheck.propTypes = {
  isValid: PropTypes.bool.isRequired,
  distributions: PropTypes.arrayOf(PropTypes.shape({
    _id: PropTypes.string.isRequired,
    available: PropTypes.bool,
    typeName: PropTypes.string,
    layer: PropTypes.string,
    name: PropTypes.string
  })).isRequired,

  t: PropTypes.func.isRequired
}

export default translate('dataset')(DistributionCheck)
{'fraction_non_alphanumeric': 0.13575214023644516, 'fraction_numerical': 0.0036689767631471666, 'mean_word_length': 3.056198347107438, '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': '5824472', 'n_tokens_mistral': 742, 'n_tokens_neox': 733, 'n_words': 142}