import React, { useContext } from "react";
import { RicosContext } from "./../../ricos-context/index.js";
import { EditorBaseUrlContext } from "./../../_shared/editor-base-url/editor-base-url-context.js";
import { Loader, MediaItemErrorMsg } from "./../../ui-components/index.js";
import styles from "../statics/styles/gallery-component-scss.js";
import { GalleryViewer } from "../viewer/gallery-viewer.js";
const renderMobileNativeLoader = ({ url }) => url ? null : /* @__PURE__ */ React.createElement("div", { className: styles.mobileNativeLoaderContainer }, /* @__PURE__ */ React.createElement(Loader, { type: "mini", disableProgress: true }));
const Gallery = ({ settings, componentData, node }) => {
  const { error } = node.attrs;
  const { t } = useContext(RicosContext);
  const { baseUrl } = useContext(EditorBaseUrlContext);
  const anchorTarget = "";
  const relValue = "";
  return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
    GalleryViewer,
    {
      componentData,
      nodeId: node.attrs.id,
      settings,
      anchorTarget,
      relValue,
      itemOverlayElement: renderMobileNativeLoader,
      baseUrl
    }
  ), !error && node.attrs.loading && /* @__PURE__ */ React.createElement(Loader, { type: "medium" }), error && /* @__PURE__ */ React.createElement(MediaItemErrorMsg, { error, t }));
};
export {
  Gallery
};
//# sourceMappingURL=component.js.map
