@dndbuilder.com/react
Version:
Drag and drop builder for React
52 lines (51 loc) • 1.77 kB
JavaScript
"use client";
import { jsxs as r, jsx as o } from "react/jsx-runtime";
import { Tooltip as e } from "../../shared/tooltip.js";
import { useAction as a } from "../../../hooks/use-action.js";
import { classNames as c } from "../../../../../../utils.js";
import { LuUndo2 as m, LuRedo2 as p } from "../../../../../../node_modules/.pnpm/react-icons@5.5.0_react@19.0.0/node_modules/react-icons/lu/index.js";
const f = ({ className: i, ...d }) => {
const { undo: n, redo: t, isRedoable: s, isUndoable: l } = a();
return /* @__PURE__ */ r(
"div",
{
className: c(
"flex h-10 items-center rounded-sm px-2 text-lg ring-1 ring-inset ring-gray-300 transition-colors duration-150 hover:bg-gray-100 hover:ring-gray-600",
i
),
...d,
children: [
/* @__PURE__ */ r(e, { children: [
/* @__PURE__ */ o(
e.Trigger,
{
type: "button",
className: "p-2 disabled:cursor-not-allowed disabled:opacity-50",
onClick: n,
disabled: !l,
children: /* @__PURE__ */ o(m, { size: 20 })
}
),
/* @__PURE__ */ o(e.Content, { children: "Undo - Ctrl/Cmd+Z" })
] }),
/* @__PURE__ */ r(e, { children: [
/* @__PURE__ */ o(
e.Trigger,
{
type: "button",
className: "p-2 disabled:cursor-not-allowed disabled:opacity-50",
onClick: t,
disabled: !s,
children: /* @__PURE__ */ o(p, { size: 20 })
}
),
/* @__PURE__ */ o(e.Content, { children: "Redo - Ctrl/Cmd+Shift+Z" })
] })
]
}
);
};
export {
f as UndoRedo
};
//# sourceMappingURL=undo-redo.js.map