'use strict';

Object.defineProperty(exports, "__esModule", {
	value: true
});

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _classnames = require('classnames');

var _classnames2 = _interopRequireDefault(_classnames);

var _HttpError = require('./HttpError.scss');

var _HttpError2 = _interopRequireDefault(_HttpError);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var className = 'http-error';

function getScopedClassName() {
	var scopedClassName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : className;

	return [_HttpError2.default[scopedClassName], scopedClassName];
}

function HttpError(props) {
	var status = props.status,
	    title = props.title,
	    message = props.message,
	    style = props.style;


	return _react2.default.createElement(
		'div',
		{
			className: (0, _classnames2.default)(getScopedClassName()),
			'data-status': status
		},
		_react2.default.createElement(
			'div',
			{
				className: (0, _classnames2.default)(getScopedClassName(className + '-content'), className + '-' + status),
				style: style
			},
			_react2.default.createElement(
				'h1',
				null,
				title
			),
			_react2.default.createElement(
				'p',
				null,
				message
			)
		)
	);
}

HttpError.propTypes = {
	status: _react.PropTypes.number.isRequired,
	title: _react.PropTypes.string.isRequired,
	message: _react.PropTypes.string.isRequired,
	style: _react.PropTypes.object // eslint-disable-line react/forbid-prop-types
};

exports.default = HttpError;