@dndbuilder.com/react
Version:
Drag and drop builder for React
62 lines (61 loc) • 2.31 kB
JavaScript
"use client";
import { jsxs as s, jsx as e } from "react/jsx-runtime";
import { BuilderConfiguration as c } from "../../../config/builder.config.js";
import { useAppDispatch as p } from "../../../hooks/use-app-dispatch.js";
import { useFrame as d } from "../../../hooks/use-frame.js";
import { duplicateTab as u, removeBlock as h } from "../../../store/builder-slice.js";
import { classNames as g } from "../../../../../../utils.js";
import { memo as f, Suspense as b } from "react";
import { FiTrash2 as x } from "../../../../../../node_modules/.pnpm/react-icons@5.5.0_react@19.0.0/node_modules/react-icons/fi/index.js";
import { IoDuplicateOutline as v } from "../../../../../../node_modules/.pnpm/react-icons@5.5.0_react@19.0.0/node_modules/react-icons/io5/index.js";
const y = f(({ blockId: o, blockType: i }) => {
const t = c.getBlock(i), { document: n } = d(), a = p(), l = (r) => {
r.stopPropagation(), a(u({ blockId: o }));
}, m = (r) => {
r.stopPropagation(), a(h(o));
};
return !n || !t ? null : /* @__PURE__ */ s(
"div",
{
className: g(
"flex items-center gap-3 rounded-sm bg-gray-800 px-2 py-1 text-gray-300"
),
children: [
/* @__PURE__ */ s(
"div",
{
role: "button",
className: "flex items-center gap-1 bg-transparent text-gray-100 hover:bg-transparent hover:text-white",
children: [
/* @__PURE__ */ e(b, { fallback: null, children: t.icon && /* @__PURE__ */ e(t.icon, {}) }),
/* @__PURE__ */ e("span", { className: "text-xs", children: t.label })
]
}
),
/* @__PURE__ */ e(
"div",
{
role: "button",
onClick: l,
className: "rounded-tr text-gray-100 hover:bg-transparent hover:text-white",
children: /* @__PURE__ */ e(v, { size: 16 })
}
),
/* @__PURE__ */ e(
"div",
{
role: "button",
onClick: m,
className: "rounded-tr text-gray-100 hover:bg-transparent hover:text-white",
children: /* @__PURE__ */ e(x, { size: 16 })
}
)
]
}
);
});
y.displayName = "TabsToolbar";
export {
y as default
};
//# sourceMappingURL=tabs-toolbar.js.map