import React__default from 'react';
import PropTypes from 'prop-types';
import { unstable_FeatureFlags, Tooltip, Link } from '@carbon/react';
import { Information } from '@carbon/icons-react';
import { settings } from '../../../../constants/Settings.js';

var iotPrefix = settings.iotPrefix;
var propTypes = {
  title: PropTypes.string,
  tooltip: PropTypes.shape({
    tooltipText: PropTypes.string,
    href: PropTypes.string,
    linkText: PropTypes.string
  })
};
var defaultProps = {
  title: 'Data',
  tooltip: null
};
var ContentFormItemTitle = function ContentFormItemTitle(_ref) {
  var title = _ref.title,
    tooltip = _ref.tooltip;
  var _ref2 = tooltip || {},
    tooltipText = _ref2.tooltipText,
    linkText = _ref2.linkText,
    href = _ref2.href;
  return /*#__PURE__*/React__default.createElement("div", {
    className: "".concat(iotPrefix, "--card-edit-form--form-section")
  }, title ? /*#__PURE__*/React__default.createElement("div", null, title) : null, /*#__PURE__*/React__default.createElement("div", null, tooltip ? /*#__PURE__*/React__default.createElement(unstable_FeatureFlags, {
    enableV12DynamicFloatingStyles: true
  }, /*#__PURE__*/React__default.createElement(Tooltip, {
    align: "left",
    triggerId: "card-edit-form-".concat(title),
    tooltipId: "card-edit-form-".concat(title),
    label: /*#__PURE__*/React__default.createElement("p", null, tooltipText, ' ', href && linkText ? /*#__PURE__*/React__default.createElement(Link, {
      href: href,
      target: "_blank",
      rel: "noopener noreferrer"
    }, linkText) : null)
  }, /*#__PURE__*/React__default.createElement(Information, null))) : null));
};
ContentFormItemTitle.propTypes = propTypes;
ContentFormItemTitle.defaultProps = defaultProps;
ContentFormItemTitle.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "ContentFormItemTitle",
  "props": {
    "title": {
      "defaultValue": {
        "value": "'Data'",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "tooltip": {
      "defaultValue": {
        "value": "null",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "shape",
        "value": {
          "tooltipText": {
            "name": "string",
            "required": false
          },
          "href": {
            "name": "string",
            "required": false
          },
          "linkText": {
            "name": "string",
            "required": false
          }
        }
      },
      "required": false
    }
  }
};
var ContentFormItemTitle$1 = ContentFormItemTitle;

export { ContentFormItemTitle$1 as default };
