All files / components/utilities error-page.jsx

100% Statements 3/3
66.67% Branches 4/6
100% Functions 1/1
100% Lines 3/3
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                
import React from 'react';
import PropTypes from 'prop-types';
 
class ErrorPage extends React.Component {
  render() {
    return (
      <div className="error-page">
        <h2 className={`headline ${this.props.theme}`}>
          {this.props.headline}
        </h2>
        <div className="error-content">
          <h3>
            {this.props.icon ? (<i className={`fa ${this.props.icon} ${this.props.theme}`} />) : ''}
            {this.props.icon && this.props.description ? ' ' : ''}
            {this.props.description}
          </h3>
          {this.props.children}
        </div>
      </div>
    );
  }
}
 
ErrorPage.propTypes = {
  theme: PropTypes.string,
  icon: PropTypes.string,
  headline: PropTypes.string,
  description: PropTypes.string
};
 
ErrorPage.defaultProps = {
  theme: 'text-red',
  icon: 'fa-warning',
  headline: '',
  description: ''
};
 
export default ErrorPage;