'use strict';

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }

require('./_commonjsHelpers-06173234.js');
require('./_to-object-329a650b.js');
require('./es6.string.iterator-cc0bbaa4.js');
require('./core.get-iterator-method-f62321d4.js');
require('./web.dom.iterable-a0e279c1.js');
var React = require('react');
var React__default = _interopDefault(React);
var slicedToArray = require('./slicedToArray-8f385299.js');

var ADFooter = function ADFooter(_ref) {
  var children = _ref.children;

  var _useState = React.useState(true),
      _useState2 = slicedToArray._slicedToArray(_useState, 2),
      showAd = _useState2[0],
      setShowAd = _useState2[1];

  return React__default.createElement(
    React__default.Fragment,
    null,
    showAd && React__default.createElement(
      'div',
      { className: 'ADFooter' },
      children,
      React__default.createElement(
        'div',
        { className: 'closeButton', onClick: function onClick() {
            return setShowAd(false);
          } },
        'x'
      )
    ),
    React__default.createElement(
      'style',
      { jsx: 'true' },
      '\n          .ADFooter {\n            width: auto;\n            margin: 0;\n            background-color: #f5f5f5;\n            position: fixed;\n            bottom: 0;\n            left: 50%;\n            transform: translateX(-50%);\n            z-index: 9000;\n          }\n          .adBox > div:empty {\n            display: none !important;\n          }\n          .adBox > div:not(:empty){\n            display: block !important;\n          }\n          .closeButton {\n            position: absolute;\n            top: -10px;\n            right: -10px;\n            background: grey;\n            color: white;\n            font-weight: 500;\n            border: 2px solid white;\n            border-radius: 50%;\n            width: 30px;\n            height: 30px;\n            text-align: center;\n            font-size: 17px;\n            cursor: pointer;\n          }\n        '
    )
  );
};

module.exports = ADFooter;
