"use strict";

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

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

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

var _classnames = _interopRequireDefault(require("classnames"));

var _reactstrap = require("reactstrap");

var _Icon = require("../../components/Icon");

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 LoginPanel(_ref) {
  var props = _extends({}, _ref);

  var columnSize = props.showDescColumn ? 8 : 4;
  var loginBoxSectionClass = (0, _classnames.default)({
    'box-section': true,
    'center': !props.showDescColumn
  });
  return _react.default.createElement(_reactstrap.Row, {
    className: "justify-content-center"
  }, _react.default.createElement(_reactstrap.Col, {
    md: columnSize
  }, _react.default.createElement(_reactstrap.CardGroup, null, _react.default.createElement(_reactstrap.Card, null, _react.default.createElement(_reactstrap.CardBody, {
    className: "box"
  }, _react.default.createElement("div", {
    className: loginBoxSectionClass
  }, !props.showDescColumn && props.appLogoUri && _react.default.createElement("img", {
    className: "logo",
    src: props.appLogoUri,
    alt: "app-logo"
  }), _react.default.createElement("h1", {
    className: "box-title"
  }, props.loginTitle), _react.default.createElement("p", {
    className: "box-desc text-muted"
  }, props.loginDesc)), _react.default.createElement("div", {
    className: "box-section section-bottom"
  }, _react.default.createElement(_reactstrap.Button, {
    color: "primary",
    size: "lg",
    block: true,
    onClick: props.onClickLogin
  }, _react.default.createElement(_Icon.IconFA, {
    name: "sign-in"
  }), " ".concat(props.buttonTextLogin))))), props.showDescColumn && _react.default.createElement(_reactstrap.Card, {
    className: "text-white bg-primary d-md-down-none"
  }, _react.default.createElement(_reactstrap.CardBody, {
    className: "box"
  }, _react.default.createElement("div", {
    className: "box-section center"
  }, props.appLogoUri && _react.default.createElement("img", {
    className: "logo",
    src: props.appLogoUri,
    alt: "app-logo"
  }), _react.default.createElement("h2", {
    className: "box-title"
  }, props.descTitle), _react.default.createElement("p", {
    className: "box-text"
  }, props.descText)), _react.default.createElement("div", {
    className: "box-section section-bottom"
  }, _react.default.createElement(_reactstrap.Button, {
    color: "light",
    size: "lg",
    block: true,
    onClick: props.onChangeLoginMode
  }, props.buttonTextDesc)))))));
}

var _default = LoginPanel;
exports.default = _default;
LoginPanel.propTypes = {
  appLogoUri: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]),
  loginTitle: _propTypes.default.string.isRequired,
  loginDesc: _propTypes.default.string,
  buttonTextLogin: _propTypes.default.string,
  descTitle: _propTypes.default.string,
  descText: _propTypes.default.string,
  buttonTextDesc: _propTypes.default.string,
  showDescColumn: _propTypes.default.bool,
  onClickLogin: _propTypes.default.func.isRequired
};
LoginPanel.defaultProps = {
  loginTitle: 'Login',
  loginDesc: 'Sign In to your account',
  buttonTextLogin: 'Login',
  descTitle: 'App Title',
  descText: 'Enter the description of app',
  buttonTextDesc: 'More',
  showDescColumn: true
};