"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var block_exports = {};
__export(block_exports, {
  BlockElement: () => BlockElement
});
module.exports = __toCommonJS(block_exports);
var import_jsx_runtime = require("react/jsx-runtime");
var import_css = require("@emotion/css");
var import_responsive_style = require("../../../../../../components/utils/responsive-style");
var import_use_style = require("../../../../use-style");
var import_types = require("../../../../../../slate/types");
function BlockElement({ element, attributes, children }) {
  const blockStyles = [
    (0, import_use_style.useStyle)({ margin: 0 }),
    (0, import_use_style.useStyle)((0, import_responsive_style.useResponsiveStyle)([element.textAlign], ([textAlign = "left"]) => ({ textAlign })))
  ];
  const quoteStyles = (0, import_use_style.useStyle)({
    padding: "0.5em 10px",
    fontSize: "1.25em",
    fontWeight: "300",
    borderLeft: "5px solid rgba(0, 0, 0, 0.1)"
  });
  switch (element.type) {
    case import_types.BlockType.Default:
    case import_types.BlockType.Paragraph:
      return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { ...attributes, className: (0, import_css.cx)(...blockStyles), children });
    case import_types.BlockType.Heading1:
      return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { ...attributes, className: (0, import_css.cx)(...blockStyles), children });
    case import_types.BlockType.Heading2:
      return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { ...attributes, className: (0, import_css.cx)(...blockStyles), children });
    case import_types.BlockType.Heading3:
      return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { ...attributes, className: (0, import_css.cx)(...blockStyles), children });
    case import_types.BlockType.Heading4:
      return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h4", { ...attributes, className: (0, import_css.cx)(...blockStyles), children });
    case import_types.BlockType.Heading5:
      return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h5", { ...attributes, className: (0, import_css.cx)(...blockStyles), children });
    case import_types.BlockType.Heading6:
      return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h6", { ...attributes, className: (0, import_css.cx)(...blockStyles), children });
    case import_types.BlockType.BlockQuote:
      return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("blockquote", { ...attributes, className: (0, import_css.cx)(...blockStyles, quoteStyles), children });
    case import_types.BlockType.OrderedList:
      return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ol", { ...attributes, className: (0, import_css.cx)(...blockStyles), style: { listStylePosition: "inside" }, children });
    case import_types.BlockType.UnorderedList:
      return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { ...attributes, className: (0, import_css.cx)(...blockStyles), style: { listStylePosition: "inside" }, children });
    case import_types.BlockType.ListItem:
      return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { ...attributes, className: (0, import_css.cx)(...blockStyles), children });
    case import_types.BlockType.ListItemChild:
      return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { ...attributes, className: (0, import_css.cx)(...blockStyles), children });
  }
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  BlockElement
});
//# sourceMappingURL=block.js.map