"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.SecondaryActionButton = exports.PrimaryActionButton = exports.Description = exports.SubTitle = exports.BlankSlate = void 0;

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

var _propTypes = _interopRequireDefault(require("prop-types"));

var _Button = require("../Button");

require("./BlankSlate.css");

var _BlurIcon = _interopRequireDefault(require("mdi-react/BlurIcon"));

var _Panel = require("../../../lib/components/Panel");

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

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }

function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }

var BlankSlate = function BlankSlate(_ref) {
  var children = _ref.children,
      _ref$alignment = _ref.alignment,
      alignment = _ref$alignment === void 0 ? '' : _ref$alignment,
      _ref$title = _ref.title,
      title = _ref$title === void 0 ? 'You do not have any content.' : _ref$title,
      _ref$headerGraphic = _ref.headerGraphic,
      headerGraphic = _ref$headerGraphic === void 0 ? _react.default.createElement(_BlurIcon.default, null) : _ref$headerGraphic,
      _ref$className = _ref.className,
      className = _ref$className === void 0 ? '' : _ref$className,
      restProps = _objectWithoutProperties(_ref, ["children", "alignment", "title", "headerGraphic", "className"]);

  return _react.default.createElement(_Panel.Panel, null, _react.default.createElement("div", _extends({}, restProps, {
    className: "vs-bs-container ".concat(alignment === 'left-side' && 'vs-bs-leftalign', " ").concat(className)
  }), _react.default.createElement("div", {
    className: "vs-bs-img"
  }, headerGraphic), _react.default.createElement("div", {
    className: "vs-bs-content"
  }, _react.default.createElement("h1", {
    className: "vs-bs-title"
  }, title), children)));
};

exports.BlankSlate = BlankSlate;
BlankSlate.propTypes = {
  title: _propTypes.default.string,
  subTitle: _propTypes.default.string,
  alignment: _propTypes.default.string,
  headerGraphic: _propTypes.default.object
};

var SubTitle = function SubTitle(_ref2) {
  var children = _ref2.children;
  return _react.default.createElement("div", {
    className: "vs-bs-subtitle"
  }, children);
};

exports.SubTitle = SubTitle;

var Description = function Description(_ref3) {
  var children = _ref3.children;
  return _react.default.createElement("p", {
    className: "vs-bs-description-text"
  }, children);
};

exports.Description = Description;

var PrimaryActionButton = function PrimaryActionButton(_ref4) {
  var label = _ref4.label,
      _ref4$handler = _ref4.handler,
      handler = _ref4$handler === void 0 ? function (clickEvent) {
    return clickEvent;
  } : _ref4$handler,
      _ref4$className = _ref4.className,
      className = _ref4$className === void 0 ? '' : _ref4$className,
      restProps = _objectWithoutProperties(_ref4, ["label", "handler", "className"]);

  return _react.default.createElement("div", null, _react.default.createElement(_Button.Button, _extends({}, restProps, {
    type: "solid-primary",
    className: "vs-bs-button-primary ".concat(className),
    onClick: handler
  }), label));
};

exports.PrimaryActionButton = PrimaryActionButton;
PrimaryActionButton.propTypes = {
  label: _propTypes.default.string,
  handler: _propTypes.default.func
};

var SecondaryActionButton = function SecondaryActionButton(_ref5) {
  var label = _ref5.label,
      _ref5$handler = _ref5.handler,
      handler = _ref5$handler === void 0 ? function (clickEvent) {
    return clickEvent;
  } : _ref5$handler,
      _ref5$className = _ref5.className,
      className = _ref5$className === void 0 ? '' : _ref5$className,
      restProps = _objectWithoutProperties(_ref5, ["label", "handler", "className"]);

  return _react.default.createElement("div", null, _react.default.createElement(_Button.Button, _extends({}, restProps, {
    type: "text",
    className: "vs-bs-button-secondary ".concat(className),
    onClick: handler
  }), label));
};

exports.SecondaryActionButton = SecondaryActionButton;
SecondaryActionButton.propTypes = {
  label: _propTypes.default.string,
  handler: _propTypes.default.func
};