import React, { useContext } from "react";
import { RicosViewerContext } from "./../../ricos-context/index.js";
import { ViewerFigure } from "../../_shared/figure/viewer-figure.js";
import { VIDEO_ROOT } from "../data-hooks.js";
import styles from "../statics/styles/video-viewer-scss.js";
import { VIDEO_TYPE } from "../types.js";
import { Video } from "./video.js";
const ViewerVideo = ({
  node,
  nodeIndex,
  NodeViewContainer,
  RicosNodesRenderer
}) => {
  const { seoMode, config, jsdomMode } = useContext(RicosViewerContext);
  const { videoData } = node;
  if (!videoData) {
    return null;
  }
  return /* @__PURE__ */ React.createElement(
    ViewerFigure,
    {
      node,
      nodeIndex,
      NodeViewContainer,
      RicosNodesRenderer
    },
    /* @__PURE__ */ React.createElement("div", { className: styles.video_container, "data-hook": VIDEO_ROOT }, /* @__PURE__ */ React.createElement(
      Video,
      {
        config: config[VIDEO_TYPE] || {},
        componentData: videoData,
        nodeId: node.id,
        seoMode: !!seoMode,
        jsdomMode,
        isLight: true
      }
    ))
  );
};
const VideoRenderer = ({ node, ...props }) => {
  return /* @__PURE__ */ React.createElement(ViewerVideo, { key: node.id, node, ...props });
};
var viewer_video_default = VideoRenderer;
export {
  viewer_video_default as default
};
//# sourceMappingURL=viewer-video.js.map

import "@wix/ricos/css/plugin-video-viewer.global.css";