'use strict';

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

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _Modal = require('react-bootstrap/lib/Modal');

var _Modal2 = _interopRequireDefault(_Modal);

var _Action = require('../Actions/Action');

var _Action2 = _interopRequireDefault(_Action);

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

/**
 * @param {object} props react props
 * @example
<Dialog name="Hello world"></Dialog>
 */
function Dialog(props) {
	return _react2.default.createElement(
		_Modal2.default,
		{
			bsSize: props.size,
			show: props.show
		},
		props.header && _react2.default.createElement(
			_Modal2.default.Header,
			{ closeButton: true },
			_react2.default.createElement(
				_Modal2.default.Title,
				null,
				props.header
			)
		),
		_react2.default.createElement(
			_Modal2.default.Body,
			null,
			props.children
		),
		props.action && _react2.default.createElement(
			_Modal2.default.Footer,
			null,
			_react2.default.createElement(_Action2.default, props.action)
		)
	);
}

Dialog.propTypes = {
	header: _react.PropTypes.string,
	size: _react.PropTypes.oneOf(['small', 'large']),
	children: _react.PropTypes.element,
	show: _react.PropTypes.bool,
	action: _react.PropTypes.shape(_Action2.default.propTypes)
};

exports.default = Dialog;