import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _objectSpread from "@babel/runtime/helpers/objectSpread";

/**
 * Web FieldsetDescription Component
 *
 */
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types'; // import classnames from 'classnames'

import { registerElement, validateDOMAttributes } from '../../shared/component-helper'; // import './style/dnb-fieldset-description.css' // no good solution to import the style here

const renderProps = {// render_content: null
};
export const propTypes = {
  text: PropTypes.string,
  class: PropTypes.string,

  /** React props */
  className: PropTypes.string,
  children: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.func]) // Web Component props
  // render_content: PropTypes.func

};
export const defaultProps = _objectSpread({
  text: null,
  class: null,

  /** React props */
  className: null,
  children: null
}, renderProps);
export default class FieldsetDescription extends PureComponent {
  static enableWebComponent() {
    registerElement(FieldsetDescription.tagName, FieldsetDescription, defaultProps);
  } // static getContent(props) {
  //   if (typeof props.render_content === 'function') {
  //     return props.render_content(props)
  //   }
  //   return null
  // }


  render() {
    const {
      text,
      className,
      class: _className
    } = this.props;
    const params = {
      className: "dnb-fieldset-description ".concat(className || _className || '') // also used for code markup simulation

    };
    validateDOMAttributes(this.props, params);
    return React.createElement("div", params, React.createElement("p", {
      className: "dnb-fieldset-description__text"
    }, text));
  }

}

_defineProperty(FieldsetDescription, "tagName", 'dnb-fieldset-description');

_defineProperty(FieldsetDescription, "defaultProps", defaultProps);

FieldsetDescription.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};