Files
blitzkit/packages/website-ue/src/hooks/useTierCompare.ts
T

17 lines
462 B
TypeScript
Raw Normal View History

2026-04-27 19:34:06 -05:00
import { api } from "../core/api/dynamic";
import { useAwait } from "./useAwait";
export function useTierCompare() {
const tiers = useAwait(() => api.tiers(), "tiers");
function compare(a: string, b: string) {
const [, tierNameA] = a.split(".");
const [, tierNameB] = b.split(".");
const tierA = tiers.tiers[tierNameA];
const tierB = tiers.tiers[tierNameB];
return tierB.carousel_level - tierA.carousel_level;
}
return compare;
}