mirror of
https://github.com/jambonz/jambonz-webapp.git
synced 2026-10-26 05:14:32 +00:00
* Implement initial Cypress testing configuration * Add docs on cypress for testing * Cypress cache for GitHub actions
21 lines
395 B
TypeScript
21 lines
395 B
TypeScript
import React from "react";
|
|
|
|
import { useSelectState } from "src/store";
|
|
|
|
import type { ACL } from "src/store/types";
|
|
|
|
export type ACLProps = {
|
|
acl: keyof ACL;
|
|
children: React.ReactNode;
|
|
};
|
|
|
|
export const AccessControl = ({ acl, children }: ACLProps) => {
|
|
const accessControl = useSelectState("accessControl");
|
|
|
|
if (accessControl[acl]) {
|
|
return <>{children}</>;
|
|
}
|
|
|
|
return null;
|
|
};
|