import React from "react";
import { normalizeLineHeight } from "./../line-spacing-utils.js";
import { captionDefaultAttributes } from "./consts.js";
import classes from "./viewer-caption-scss.js";
const ViewerCaption = ({
  node,
  nodeIndex,
  NodeViewContainer,
  RicosNodesRenderer
}) => {
  const { lineHeight, textAlignment: textAlign } = node.captionData?.textStyle || {};
  const nodeStyle = {
    paddingTop: node.style?.paddingTop || captionDefaultAttributes.styleDefaults.paddingTop,
    paddingBottom: node.style?.paddingBottom || captionDefaultAttributes.styleDefaults.paddingBottom,
    ...lineHeight && { lineHeight: normalizeLineHeight(lineHeight) },
    ...textAlign && { textAlign }
  };
  return node.nodes?.length ? /* @__PURE__ */ React.createElement(NodeViewContainer, { node, nodeIndex }, /* @__PURE__ */ React.createElement("figcaption", { className: classes.imageCaption, style: nodeStyle }, /* @__PURE__ */ React.createElement(RicosNodesRenderer, { nodes: node.nodes, shouldParagraphApplyTextStyle: true }))) : null;
};
const CaptionRenderer = (props) => {
  return /* @__PURE__ */ React.createElement(ViewerCaption, { key: props.node.id, ...props });
};
var viewer_caption_default = CaptionRenderer;
export {
  ViewerCaption,
  viewer_caption_default as default
};
//# sourceMappingURL=viewer-caption.js.map

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