import React from 'react';
import classnames from 'classnames';
import { NovaCompositionNavigationArrowDown as ArrowIcon } from '@coorpacademy/nova-icons';
import { propTypes } from './types';
import styles from './style.css';
export const ICONS = {
  arrow: ArrowIcon
};
const ExpandableItem = ({
  icon,
  title,
  isExpended,
  isLink,
  content,
  onClick,
  image,
  ariaLabel
}) => {
  const Icon = ICONS[icon];
  return /*#__PURE__*/React.createElement("div", {
    className: isExpended ? styles.expendedContainer : styles.container
  }, isLink ? /*#__PURE__*/React.createElement("a", {
    className: classnames(styles.header, isExpended ? styles.expendedHeader : null),
    onClick: onClick,
    "aria-label": ariaLabel
  }, /*#__PURE__*/React.createElement("h3", {
    className: styles.title
  }, title), Icon ? /*#__PURE__*/React.createElement(Icon, {
    className: classnames(styles.icon, isExpended ? styles.expendedIcon : null, isLink ? styles.linkIcon : null)
  }) : null) : /*#__PURE__*/React.createElement("div", {
    className: classnames(styles.header, isExpended ? styles.expendedHeader : null),
    onClick: onClick,
    id: `${title}_expended_item_id`,
    "aria-controls": `${title}_expended_item_aria-controls`,
    "aria-expanded": isExpended
  }, /*#__PURE__*/React.createElement("h3", {
    className: styles.title
  }, title), Icon ? /*#__PURE__*/React.createElement(Icon, {
    className: classnames(styles.icon, isExpended ? styles.expendedIcon : null, isLink ? styles.linkIcon : null)
  }) : null), isExpended ? /*#__PURE__*/React.createElement("div", {
    id: `${title}_expended_item_aria-controls`,
    role: "region",
    "aria-labelledby": `${title}_expended_item_id`
  }, /*#__PURE__*/React.createElement("div", {
    className: styles.content // eslint-disable-next-line react/no-danger
    ,
    dangerouslySetInnerHTML: {
      __html: content
    }
  }), image ? /*#__PURE__*/React.createElement("img", {
    className: styles.image,
    src: image,
    alt: ''
  }) : null) : null);
};
ExpandableItem.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
export default ExpandableItem;
//# sourceMappingURL=index.js.map