All files / src/emptystate/EditionPage EditionPage.js

100% Statements 5/5
50% Branches 5/10
100% Functions 2/2
100% Lines 5/5

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 41 42 43 44 45 46 47 48 49                1x       1x 1x                                                     1x 1x              
import React, { Component } from 'react';
import { defaultProps } from './props/defaultProps';
import { propTypes } from './props/propTypes';
import EmptyCrmPotential from '@zohodesk/svg/lib/emptystate/version3/EmptyCrmPotential';
import style from './EditionPage.css';
 
export default class EditionPage extends Component {
  constructor(props) {
    super(props);
  }
 
  render() {
    let { title, subtitle, information, dataId, footerText, onButtonClick, butttonText, children } = this.props;
    return (
      <div className={style.editionContainer} data-id={dataId} data-test-id={dataId}>
        <div className={style.svg}>
          <EmptyCrmPotential />
        </div>
        <div className={style.header}>{title}</div>
        {subtitle ? <div className={style.description}>{subtitle}</div> : null}
 
        <div className={style.description}>
          {information ? `${information} ` : null}
          {butttonText ? (
            <span className={style.button} data-id={`${dataId}_button`} data-test-id={`${dataId}_button`} onClick={onButtonClick}>
              {butttonText}
            </span>
          ) : null}
        </div>
        {children ? <div className={style.content}>{children}</div> : null}
 
        {footerText ? (
          <div data-id={`${dataId}_footerText`} data-test-id={`${dataId}_footerText`} className={style.footer}>
            <div dangerouslySetInnerHTML={{ __html: footerText }} />
          </div>
        ) : null}
      </div>
    );
  }
}
EditionPage.defaultProps = defaultProps;
EditionPage.propTypes = propTypes;
 
// if (__DOCS__) {
//   EditionPage.docs = {
//     componentGroup: 'EmptyState'
//   };
// }