@dndbuilder.com/react
Version:
Drag and drop builder for React
43 lines (42 loc) • 1.71 kB
JavaScript
"use client";
import { jsxs as n, jsx as r } from "react/jsx-runtime";
import u from "../../../components/base/add-new-section.js";
import C from "../../../components/base/editor-render-children.js";
import { Drawer as c } from "../../../components/shared/drawer.js";
import { RenderIcon as S } from "../../../components/shared/render-icon.js";
import { useState as B } from "react";
const y = ({
id: g,
settings: e,
children: m,
meta: o,
isEditable: f
}) => {
var i, t, l, a, d, s, p;
const h = (o == null ? void 0 : o.locale) || "en", [N, k] = B(!1), w = (b) => {
k(b);
}, x = ((t = (i = e.content) == null ? void 0 : i.direction) == null ? void 0 : t.desktop) || "left";
return /* @__PURE__ */ n(c, { open: N, onOpenChange: w, children: [
/* @__PURE__ */ n(c.Trigger, { className: "reset flex items-center gap-2", children: [
((l = e.trigger) == null ? void 0 : l.icon) && /* @__PURE__ */ r(
S,
{
iconSet: e.trigger.icon.iconSet,
iconName: e.trigger.icon.iconName,
color: (a = e.trigger.icon.color) == null ? void 0 : a.default,
className: "drawer-trigger-icon"
}
),
/* @__PURE__ */ r("span", { className: "drawer-trigger-text", children: (p = (s = (d = e.trigger) == null ? void 0 : d.text) == null ? void 0 : s.content) == null ? void 0 : p[h] })
] }),
/* @__PURE__ */ n(c.Content, { direction: x, children: [
/* @__PURE__ */ r(C, { blocks: m, meta: o, isEditable: f ?? !1 }),
/* @__PURE__ */ r(u, { blockId: g, showBlockLibrary: !1, className: "p-2" })
] }),
/* @__PURE__ */ r(c.Backdrop, {})
] });
};
export {
y as default
};
//# sourceMappingURL=drawer.block.js.map