import { u as useRecordVisibilityChanges, j as jsxRuntimeExports } from "./doenetml-cB_aZGJ5.js";
import React__default, { useRef } from "react";
import { u as useDoenetRenderer } from "./useDoenetRenderer-DN3Z9CW3.js";
import { F as FontAwesomeIcon } from "./index.es-DKppzeUo.js";
import { f as faComment } from "./index-CwWLcRpc.js";
import { a as addCommasForCompositeRanges } from "./composites-DgtFnuE1.js";
const feedback = React__default.memo(function Feedback(props) {
  let { id, SVs, children, actions, callAction } = useDoenetRenderer(props);
  const ref = useRef(null);
  useRecordVisibilityChanges(ref, callAction, actions);
  if (SVs.hidden) {
    return null;
  }
  let icon = /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faComment });
  if (SVs._compositeReplacementActiveRange) {
    children = addCommasForCompositeRanges({
      children,
      compositeReplacementActiveRange: SVs._compositeReplacementActiveRange,
      startInd: 0,
      endInd: children.length - 1
    });
  }
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { ref, className: "feedback", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { tabIndex: 0, children: [
      icon,
      " Feedback"
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("aside", { id, children: [
      SVs.feedbackText,
      children
    ] })
  ] });
});
export {
  feedback as default
};
