import _extends from "@babel/runtime/helpers/extends";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import React, { useRef } from "react";
import cx from "classnames";
import Box from "../../Box";
import createComponent from "../../system/createComponent";
import getClasses from "./styles";
var AccordionContent = /*#__PURE__*/React.forwardRef(function (props, componentRef) {
  var _ref$current;

  var ref = useRef(null);
  var height = (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.getBoundingClientRect().height;
  var classes = getClasses({
    height: height
  });
  var contentClasses = cx(props.className, classes.content, _defineProperty({}, classes.contentExpanded, props.expanded));
  return /*#__PURE__*/React.createElement("div", {
    className: contentClasses,
    ref: componentRef
  }, /*#__PURE__*/React.createElement(Box, _extends({
    ref: ref,
    p: "md"
  }, props)));
});
export default createComponent(AccordionContent);