import { useProfile } from "../hooks/useProfile";

export const hasUserPermission = (permission) => {
  const { profile } = useProfile();
  if (profile) {
    if (!permission || typeof permission !== "string") {
      return false;
    }
    return profile?.featurePermissions.includes(permission);
  }
  return false;
};
