import React, { useContext } from "react";
import { useBiCallbacks } from "./../../../_shared/bi-helpers-context/bi-helpers-context.js";
import { GlobalContext } from "./../../../wix-rich-content-common/index.js";
import { BlockSpoilerComponent } from "../block-spoiler-component.js";
const SpoilerViewerWrapper = (props) => {
  const { componentData, type, children } = props;
  const hasSpoiler = componentData?.config?.spoiler?.enabled || false;
  const { isMobile, t } = useContext(GlobalContext);
  const helpers = useBiCallbacks();
  if (!hasSpoiler) {
    return children;
  }
  const pluginType = type.toLowerCase().replace(/^./, (c) => c.toUpperCase());
  return /* @__PURE__ */ React.createElement(
    BlockSpoilerComponent,
    {
      pluginType,
      isMobile,
      t,
      ...props,
      helpers
    },
    children
  );
};
export {
  SpoilerViewerWrapper
};
//# sourceMappingURL=spoiler-viewer-wrapper.js.map
