var React = require('react/addons'),
	Tappable = require('react-tappable');

module.exports = React.createClass({
	propTypes: {
		className: React.PropTypes.string,
		visible: React.PropTypes.bool,
		iconKey: React.PropTypes.string,
		iconType: React.PropTypes.string,
		header: React.PropTypes.string,
		text: React.PropTypes.string,
		primaryActionText: React.PropTypes.string,
		primaryActionFn: React.PropTypes.func,
		secondaryActionText: React.PropTypes.string,
		secondaryActionFn: React.PropTypes.func
	},
	getDefaultProps: function() {
		return {
			className: ''
		};
	},
	render: function() {
		if (!this.props.visible) return null

		var className = this.props.className ? ('Modal-dialog ' + this.props.className) : 'Modal-dialog';

		var icon = this.props.iconKey ? <div className={'Modal-icon ' + this.props.iconKey + ' ' + this.props.iconType} /> : null;
		var header = this.props.header ? <div className="Modal-header">{this.props.header}</div> : null;
		var text = this.props.text ? <div className="Modal-text" dangerouslySetInnerHTML={{__html: this.props.text}} /> : null;
		var primaryAction = this.props.primaryActionText ? <Tappable onTap={this.props.primaryActionFn} className="Modal-action Modal-action-primary">{this.props.primaryActionText}</Tappable> : null;
		var secondaryAction = this.props.secondaryActionText ? <Tappable onTap={this.props.secondaryActionFn} className="Modal-action Modal-action-secondary">{this.props.secondaryActionText}</Tappable> : null;

		var actions = primaryAction ? ( <div className="Modal-actions">
			{secondaryAction}
			{primaryAction}
		</div> ) : null;

		return (
			<div>
				<div className={'Modal visible'}>
					<div className={className}>
						{icon}
						{header}
						{text}
						{actions}
					</div>
				</div>
				<div className="Modal-backdrop" />
			</div>
		);
	}
});

@@ -1770,26 +1770,16 @@
 %3C/div%3E%0A%09
-%09%09%09%3C/div%3E%0A
 %09%09%09%09%3Cdiv
@@ -1809,16 +1809,27 @@
 rop%22 /%3E%0A
+%09%09%09%09%3C/div%3E%0A
 %09%09%09%3C/div

revert div heirarchy change in 5020547