import { useAuth } from "@/app/auth/AuthProvider.jsx";
import { PERMISSIONS } from "@/app/permissions";

export function useMenuAbilities() {
  const { can } = useAuth();

  return {
    canCreateMenu: can(PERMISSIONS.menuCreate),
    canCreatePermission: can(PERMISSIONS.permissionCreate),
    canDeleteMenu: can(PERMISSIONS.menuDelete),
    canDeletePermission: can(PERMISSIONS.permissionDelete),
    canLoadPermissions: can(PERMISSIONS.permissionView) || can(PERMISSIONS.rolePermission) || can(PERMISSIONS.roleManage),
    canSortMenu: can(PERMISSIONS.menuSort),
    canSyncPermission: can(PERMISSIONS.permissionSync),
    canUpdateMenu: can(PERMISSIONS.menuUpdate),
    canUpdatePermission: can(PERMISSIONS.permissionUpdate),
    canVisibleMenu: can(PERMISSIONS.menuVisible)
  };
}
