'use strict';

var react = require('@carbon/react');
var PropTypes = require('prop-types');
var React = require('react');
var classnames = require('classnames');
var Settings = require('../../constants/Settings.js');
var iconsReact = require('@carbon/icons-react');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
var React__default = /*#__PURE__*/_interopDefault(React);
var classnames__default = /*#__PURE__*/_interopDefault(classnames);

// const { g10 } = v10;
var iotPrefix = Settings.settings.iotPrefix;
var propTypes = {
  /** Title to show on the card */
  title: PropTypes__default.default.string.isRequired,
  /** Callback function when icon is clicked */
  onClick: PropTypes__default.default.func.isRequired,
  testId: PropTypes__default.default.string
};

/**
 * Clickable card that shows "Add" button
 */
var AddCard = function AddCard(_ref) {
  var onClick = _ref.onClick,
    title = _ref.title,
    className = _ref.className,
    testId = _ref.testId;
  return /*#__PURE__*/React__default.default.createElement(react.ClickableTile, {
    "data-testid": testId,
    className: classnames__default.default("".concat(iotPrefix, "-add-card"), className),
    onClick: onClick
  }, /*#__PURE__*/React__default.default.createElement("p", {
    className: "".concat(iotPrefix, "-addcard-title")
  }, title), /*#__PURE__*/React__default.default.createElement(iconsReact.Add, {
    size: 20,
    description: title
  }));
};
AddCard.propTypes = propTypes;
AddCard.defaultProps = {
  testId: 'add-card-tile'
};
AddCard.__docgenInfo = {
  "description": "Clickable card that shows \"Add\" button",
  "methods": [],
  "displayName": "AddCard",
  "props": {
    "testId": {
      "defaultValue": {
        "value": "'add-card-tile'",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "title": {
      "description": "Title to show on the card",
      "type": {
        "name": "string"
      },
      "required": true
    },
    "onClick": {
      "description": "Callback function when icon is clicked",
      "type": {
        "name": "func"
      },
      "required": true
    }
  }
};
var AddCard$1 = AddCard;

module.exports = AddCard$1;
