mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-12-06 16:24:29 +01:00
18 lines
488 B
TypeScript
18 lines
488 B
TypeScript
import { api } from "../api/dynamic";
|
|
import { useAwait } from "./useAwait";
|
|
|
|
export function useEquipment(presetId: string, priceId: string) {
|
|
const [, presetName] = presetId.split(".");
|
|
const [, priceName] = priceId.split(".");
|
|
const preset = useAwait(
|
|
() => api.equipmentPreset(presetId),
|
|
`equipment-preset-${presetName}`,
|
|
);
|
|
const price = useAwait(
|
|
() => api.equipmentPricePreset(priceId),
|
|
`equipment-price-${priceName}`,
|
|
);
|
|
|
|
return { preset, price };
|
|
}
|