const GLOBAL_HAS_VALUE = process.env.NEXT_PUBLIC_HAS_VALUE;
const hasPermissionsValue = GLOBAL_HAS_VALUE ? JSON.parse(GLOBAL_HAS_VALUE) : [];

const AppPermission = ({ children , permissions }) => {
    return permissions.some(permission => hasPermissionsValue.includes(permission)) ? <>{children}</> : null;
};

export default AppPermission;
