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, { useState } 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 CCardBody from './CCardBody';
import CIcon from './CIcon';
import CButtonGroup from './CButtonGroup';
import CDropdownToggle from './CDropdownToggle';
import CDropdownMenu from './CDropdownMenu';
import CDropdownItem from './CDropdownItem';
import CDropdown from './CDropdown';
import Slot from './Shared/Slot.js';

//component - CoreUI / CWidgetDropdown

var CWidgetDropdown = function CWidgetDropdown(props) {
  var children = props.children,
      className = props.className,
      cssModule = props.cssModule,
      header = props.header,
      text = props.text,
      color = props.color,
      toggle = props.toggle,
      dropdownSlot = props.dropdownSlot,
      mainText = props.mainText,
      smallText = props.smallText,
      value = props.value,
      variant = props.variant,
      attributes = _objectWithoutProperties(props, ['children', 'className', 'cssModule', 'header', 'text', 'color', 'toggle', 'dropdownSlot', 'mainText', 'smallText', 'value', 'variant']);

  var _useState = useState(false),
      isOpen = _useState[0],
      setIsOpen = _useState[1];

  return React.createElement(
    CCard,
    _extends({}, attributes, { custom: true, className: 'text-white', color: color }),
    React.createElement(
      CCardBody,
      { className: 'pb-0 d-flex justify-content-between' },
      React.createElement(
        'div',
        null,
        header ? React.createElement(
          'div',
          { className: 'text-value-lg' },
          header
        ) : '',
        mainText ? React.createElement(
          'div',
          null,
          text
        ) : ''
      ),
      React.createElement(Slot, { content: dropdownSlot })
    ),
    children
  );
};

CWidgetDropdown.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,
  text: PropTypes.string,
  color: PropTypes.string,
  toggle: PropTypes.func,
  dropdownSlot: PropTypes.node,
  //old
  mainText: PropTypes.string,
  smallText: PropTypes.string,
  value: PropTypes.string,
  variant: PropTypes.string
} : {};

CWidgetDropdown.defaultProps = {
  header: '89.9%',
  text: 'text',
  mainText: 'Widget title',
  smallText: 'Widget helper text',
  // color: '',
  value: '25',
  variant: ''
};

export default CWidgetDropdown;