# All files / src/components/item item.jsx

87.72% Statements 50/57
56.76% Branches 21/37
100% Functions 12/12
91.89% Lines 34/37

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39

    1x

    1x

    1x

    1x

    1x

    1x

    1x

    1x

    1x

    1x

    1x

    4x

    49x

    49x

    1x

    1x
    1x

    49x
     import React, { Component } from 'react';
    import PropTypes from 'prop-types';
    import classnames from 'classnames';

    import styles from './item.less';

    class Item extends Component {
      static displayName = 'ItemComponent';IEE

      static propTypes = {
        clickHandler: PropTypes.func.isRequired,
        description: PropTypes.string.isRequired,
        title: PropTypes.string.isRequired,
        dataTestId: PropTypes.string
      };

      /**
       * Render the Item component.
       *
       * @returns {React.Component} The rendered component.
       */
      render() {
        return (
          <div className={classnames(styles['preferences-body-item'])}>
            <label>
              <input type="checkbox" data-test-id={this.props.dataTestId} onClick={this.props.clickHandler} />
              <span>{this.props.title}</span>
            </label>I
            <p>
              {this.props.description}I
            </p>
          </div>EI
        );
      }
    }

    export default Item;
    export { Item };