asb_cloud_front/src/components/Private/PrivateMenuItem.jsx
2021-09-03 14:27:00 +05:00

12 lines
251 B
JavaScript

import { Menu } from "antd";
import { isInRole } from './PrivateContent'
export const PrivateMenuItem = ({ children, roles, ...other }) => {
if(!isInRole(roles))
return null
return <Menu.Item {...other}>
{children}
</Menu.Item>;
}