"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _preact = require("preact");

var _section = _interopRequireDefault(require("./section"));

var _componentCode = _interopRequireDefault(require("./component-code"));

var _dialog = require("./../dialog");

var _button = require("../button");

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

class Container extends _preact.Component {
  constructor(props) {
    super(props);
    this.state = {
      open: false
    };

    this.open = () => this.setState({
      open: true
    });

    this.close = () => this.setState({
      open: false
    });
  }

  render(props, {
    open
  }) {
    return (0, _preact.h)(_section.default, {
      title: "Dialog"
    }, (0, _preact.h)(_componentCode.default, {
      name: "Dialog",
      code: "<Dialog doClose={this.close} title=\"A Dialog\">\n  Hello there\n</Dialog>"
    }, (0, _preact.h)(_button.Button, {
      onClick: this.open
    }, "Open"), open && (0, _preact.h)(_dialog.Dialog, {
      doClose: this.close,
      title: "A Dialog with a really, really, ridiculously long title",
      bottom: (0, _preact.h)("div", null, (0, _preact.h)(_button.Button, {
        onClick: this.close
      }, "Done"))
    }, "Hello there", (0, _preact.h)("p", null, "long thing"), (0, _preact.h)("p", null, "long thing"), (0, _preact.h)(_button.Button, null, "Some button"))));
  }

}

var _default = Container;
exports.default = _default;