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;
|