# All files / react/Empty index.jsx

66.67% Statements 2/3
0% Branches 0/4
0% Functions 0/1
66.67% Lines 2/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    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
    40

    1x

    1x

     import React from 'react'
    import classNames from 'classnames'
    import PropTypes from 'prop-types'
    import { Text, MainTitle } from '../Text'
    import Icon from '../Icon'
    import styles from './styles.styl'

    export const Empty = ({ icon, title, text, children, className }) => {
      return (
        <div className={classNames(styles['c-empty'], className)}>
          <Icon
            className={styles['c-empty-img']}
            icon={icon}
            width="100%"
            height="100%"
          />
          {title && (
            <MainTitle tag="h2" className={styles['c-empty-title']}>
              {title}
            </MainTitle>
          )}
          {text && (
            <Text tag="p" className={styles['c-empty-text']}>
              {text}
            </Text>
          )}
          <div className={styles['c-empty-text']}>{children}</div>
        </div>
      )
    }

    Empty.propTypes = {
      icon: PropTypes.object.isRequired,
      title: PropTypes.node.isRequired,
      text: PropTypes.node,
      className: PropTypes.string
    }

    export default Empty