import _extends from "@babel/runtime/helpers/extends";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["open", "className"];
import React from 'react';
import PropTypes from "prop-types";
import cx from "classnames";
import ChevronRight from "../Icon/ChevronRight";
import createComponent from "../system/createComponent";
import getClasses from "./styles";
var CollapseTrigger = /*#__PURE__*/React.forwardRef(function (props, ref) {
  var open = props.open,
      className = props.className,
      rest = _objectWithoutProperties(props, _excluded);

  var classes = getClasses();
  return /*#__PURE__*/React.createElement("button", _extends({
    type: "button",
    ref: ref,
    className: cx(classes.button, className)
  }, rest), /*#__PURE__*/React.createElement(ChevronRight, {
    className: cx(classes.icon, _defineProperty({}, classes.iconCollapsed, open)),
    size: 24,
    color: "currentColor"
  }));
}); // @ts-ignore

CollapseTrigger.propTypes = {
  open: PropTypes.bool.isRequired,
  className: PropTypes.string,
  sx: PropTypes.object
}; // @ts-ignore

CollapseTrigger.defaultProps = {};

if (process.env.NODE_ENV !== "production") {
  CollapseTrigger.displayName = "CollapseTrigger";
}

export default createComponent(CollapseTrigger);