@eristack/policy-ui
Version:
RBAC and PBAC gate components with v0 allowed override
26 lines (25 loc) • 693 B
JavaScript
// src/can.tsx
import { Fragment, jsx } from "react/jsx-runtime";
function Can({
permission: _permission,
allowed = true,
children,
fallback = null
}) {
return allowed ? /* @__PURE__ */ jsx(Fragment, { children }) : /* @__PURE__ */ jsx(Fragment, { children: fallback });
}
// src/business-policy-gate.tsx
import { Fragment as Fragment2, jsx as jsx2 } from "react/jsx-runtime";
function BusinessPolicyGate({
policyId: _policyId,
allowed = true,
children,
fallback = null
}) {
return allowed ? /* @__PURE__ */ jsx2(Fragment2, { children }) : /* @__PURE__ */ jsx2(Fragment2, { children: fallback });
}
export {
BusinessPolicyGate,
Can
};
//# sourceMappingURL=index.js.map