import classNames from "classnames";
import React, { useContext } from "react";
import { RicosNodeContext } from "./../../ricos-context/index.js";
import { COLLAPSIBLE_LIST_ITEM_BODY, COLLAPSIBLE_LIST_ITEM_TITLE } from "../data-hooks.js";
import classes from "../statics/styles/collapsible-list-pair-scss.js";
import { getAlignmentFromDirection } from "../utils.js";
const CollapsibleListItemProperty = ({
  node,
  RicosNodesRenderer,
  type
}) => {
  const { parentNode: rootNode } = useContext(RicosNodeContext);
  const rootNodeDirection = rootNode?.collapsibleListData?.direction;
  const listAlignment = rootNodeDirection ? getAlignmentFromDirection(rootNodeDirection) : void 0;
  return /* @__PURE__ */ React.createElement(
    "div",
    {
      className: classNames(classes.container, classes.viewerContainer, classes.innerEditor, {
        [classes.titleContainer]: type === "title"
      }),
      "data-hook": type === "title" ? COLLAPSIBLE_LIST_ITEM_TITLE : COLLAPSIBLE_LIST_ITEM_BODY
    },
    /* @__PURE__ */ React.createElement(
      "div",
      {
        style: {
          width: "100%",
          textAlign: listAlignment
        }
      },
      /* @__PURE__ */ React.createElement(RicosNodesRenderer, { nodes: node.nodes ?? [], shouldParagraphApplyTextStyle: true })
    )
  );
};
const CollapsibleListItemTitleProperty = ({ node, ...props }) => {
  return /* @__PURE__ */ React.createElement(CollapsibleListItemProperty, { key: node.id, node, ...props, type: "title" });
};
const CollapsibleListItemBodyProperty = ({ node, ...props }) => {
  return /* @__PURE__ */ React.createElement(CollapsibleListItemProperty, { key: node.id, node, ...props, type: "body" });
};
var collapsible_item_property_default = CollapsibleListItemProperty;
export {
  CollapsibleListItemBodyProperty,
  CollapsibleListItemTitleProperty,
  collapsible_item_property_default as default
};
//# sourceMappingURL=collapsible-item-property.js.map

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