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