UNPKG

@konstructio/ui

Version:

A set of reusable and customizable React components built for konstruct.io

19 lines (18 loc) 489 B
import { useToggle as l } from "../../../hooks/useToggle.js"; import { CommandContext as p } from "./Command.context.js"; import { useCallback as o } from "react"; import { jsx as s } from "react/jsx-runtime"; var c = ({ children: r }) => { const [t, e] = l(!1), n = o((a) => e(a), [e]), m = o(() => e(), [e]); return /* @__PURE__ */ s(p.Provider, { value: { isOpen: t, setOpen: n, toggleOpen: m }, children: r }); }; export { c as CommandProvider };