"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

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

var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));

var _react = _interopRequireDefault(require("react"));

var _CustomDialog = _interopRequireDefault(require("../../components/content/CustomDialog"));

var _Button = _interopRequireDefault(require("../../components/elements/buttons/Button"));

var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));

var _default = {
  title: 'Content/CustomDialog',
  component: _CustomDialog.default
};
exports.default = _default;

var Default = function Default() {
  var _React$useState = _react.default.useState(false),
      _React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
      open = _React$useState2[0],
      setOpen = _React$useState2[1];

  var handleClickOpen = function handleClickOpen() {
    setOpen(true);
  };

  var handleClose = function handleClose() {
    setOpen(false);
  };

  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Typography.default, null, "This is a Dialog with children, controlled by a Button"), /*#__PURE__*/_react.default.createElement(_Button.default, {
    onClick: function onClick() {
      return setOpen(function (prev) {
        return !prev;
      });
    }
  }, "Dialog"), /*#__PURE__*/_react.default.createElement(_CustomDialog.default, {
    handleClickOpen: handleClickOpen,
    handleClose: handleClose,
    open: open,
    title: "This is Dialog title"
  }, "This is a Dialog chilldren"));
};

exports.Default = Default;

var WithActions = function WithActions() {
  var _React$useState3 = _react.default.useState(false),
      _React$useState4 = (0, _slicedToArray2.default)(_React$useState3, 2),
      open = _React$useState4[0],
      setOpen = _React$useState4[1];

  var handleClickOpen = function handleClickOpen() {
    setOpen(true);
  };

  var handleClose = function handleClose() {
    setOpen(false);
  };

  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Typography.default, null, "This is a Dialog with children, controlled by a Button, with actions"), /*#__PURE__*/_react.default.createElement(_Button.default, {
    onClick: function onClick() {
      return setOpen(function (prev) {
        return !prev;
      });
    }
  }, "Dialog"), /*#__PURE__*/_react.default.createElement(_CustomDialog.default, {
    handleClickOpen: handleClickOpen,
    handleClose: handleClose,
    open: open,
    title: "This is Dialog title",
    actions: [/*#__PURE__*/_react.default.createElement(_Button.default, {
      onClick: handleClose,
      color: "primary",
      variant: "text"
    }, "Disagree"), /*#__PURE__*/_react.default.createElement(_Button.default, {
      onClick: handleClose,
      color: "primary",
      autofocus: true
    }, "Agree")]
  }, "This is a Dialog chilldren"));
};

exports.WithActions = WithActions;