import { r as reactExports } from "./worker-entry-DSg7Z9cD.js";
import { u as useAuth, s as supabase } from "./router-CNfq_WjB.js";
function useIsAdmin() {
  const { user } = useAuth();
  const [isAdmin, setIsAdmin] = reactExports.useState(null);
  reactExports.useEffect(() => {
    if (!user) {
      setIsAdmin(false);
      return;
    }
    supabase.from("user_roles").select("role").eq("user_id", user.id).eq("role", "admin").maybeSingle().then(({ data }) => setIsAdmin(!!data));
  }, [user]);
  return isAdmin;
}
export {
  useIsAdmin as u
};
