var _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; };

function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }

import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';

import { mapToCssModules, omit, pick, TransitionPropTypeKeys, TransitionTimeouts, tagPropType } from './Shared/helper.js';
//
import CCard from './CCard';
//import CProgress from './CProgress';
import CCardBody from './CCardBody';
//import CCardHeader from './CCardHeader';
//import CCardFooter from './CCardFooter';

//component - CoreUI / CWidgetSimple

var CWidgetSimple = function CWidgetSimple(props) {
  var children = props.children,
      className = props.className,
      cssModule = props.cssModule,
      header = props.header,
      mainText = props.mainText,
      color = props.color,
      variant = props.variant,
      attributes = _objectWithoutProperties(props, ['children', 'className', 'cssModule', 'header', 'mainText', 'color', 'variant']);

  var card = { style: '', bgColor: '' };

  if (variant === 'inverse') {
    card.style = 'text-white';
    card.bgColor = 'bg-' + color;
  }

  var classes = mapToCssModules(classNames(className, card.style, card.bgColor), cssModule);

  return React.createElement(
    CCard,
    _extends({}, attributes, { custom: true, className: classes }),
    React.createElement(
      CCardBody,
      { className: 'text-center' },
      React.createElement(
        'div',
        { className: 'text-muted small text-uppercase font-weight-bold' },
        header
      ),
      React.createElement(
        'div',
        { className: 'text-value-xl py-3' },
        mainText
      ),
      children
    )
  );
};

CWidgetSimple.propTypes = process.env.NODE_ENV !== "production" ? {
  children: PropTypes.node,
  className: PropTypes.string,
  cssModule: PropTypes.object,
  //
  innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string]),
  header: PropTypes.string,
  mainText: PropTypes.string,
  color: PropTypes.string,
  variant: PropTypes.string
} : {};

CWidgetSimple.defaultProps = {
  header: 'title',
  mainText: 'text',
  color: '',
  variant: ''
};

export default CWidgetSimple;