'use strict';

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

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _Modal = require('../Modal');

var _Modal2 = _interopRequireDefault(_Modal);

var _reactstrap = require('reactstrap');

require('./style.css');

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

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var TestComponent = function (_Component) {
    _inherits(TestComponent, _Component);

    function TestComponent(props) {
        _classCallCheck(this, TestComponent);

        var _this = _possibleConstructorReturn(this, (TestComponent.__proto__ || Object.getPrototypeOf(TestComponent)).call(this, props));

        _this.state = {
            showModal: false,
            userInput: ''
        };
        return _this;
    }

    _createClass(TestComponent, [{
        key: 'render',
        value: function render() {
            var _this2 = this;

            return _react2.default.createElement(
                'div',
                null,
                _react2.default.createElement(
                    _Modal2.default,
                    {
                        showModal: this.state.showModal,
                        hideModal: function hideModal() {
                            return _this2.setState({ showModal: false });
                        },
                        ModalName: 'Form Name',
                        action1: 'CLOSE',
                        action2: 'SUBMIT',
                        onAction2Clicked: function onAction2Clicked() {
                            return alert('user input: ' + _this2.state.userInput);
                        },
                        onAction1Clicked: function onAction1Clicked() {
                            return _this2.setState({ showModal: false });
                        }
                    },
                    _react2.default.createElement(
                        'div',
                        { style: { "textAlign": "center" } },
                        'Please give a name to your form'
                    ),
                    _react2.default.createElement(
                        'div',
                        { style: { "display": "flex", "justify-content": "center" } },
                        _react2.default.createElement('input', {
                            onChange: function onChange(e) {
                                return _this2.setState({ userInput: e.target.value });
                            },
                            value: this.state.userInput,
                            style: _defineProperty({ 'width': '96%', "margin-top": "10px", "height": "30px", "border-radius": "5px", "padding": "0px 0px 0px 5px", "border": "none" }, 'border', "solid 1px #d9d9d9"),
                            placeholder: 'Please input your form name' })
                    )
                )
            );
        }
    }]);

    return TestComponent;
}(_react.Component);

exports.default = TestComponent;