asb_cloud_front/src/components/Private/PrivateMenuItem.jsx

12 lines
251 B
React
Raw Normal View History

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>;
}