2026-05-17 13:46:53 -05:00
|
|
|
import type { TankCatalogComponent } from "@protos/blitz_static_tank_component";
|
2026-05-17 13:19:28 -05:00
|
|
|
import { api } from "../api/dynamic";
|
|
|
|
|
import { useAwait } from "./useAwait";
|
|
|
|
|
|
2026-05-17 13:46:53 -05:00
|
|
|
export function useEquipment(tank: TankCatalogComponent) {
|
2026-05-17 13:19:28 -05:00
|
|
|
const equipment = useAwait(() => api.equipment(), "equipment");
|
2026-05-17 13:46:53 -05:00
|
|
|
const preset = equipment.presets[tank.equipment_preset_catalog_id];
|
|
|
|
|
const price = equipment.prices[tank.equipment_price_preset_catalog_id];
|
2026-05-17 13:19:28 -05:00
|
|
|
|
2026-05-17 13:46:53 -05:00
|
|
|
return { preset, price, equipments: equipment.equipments };
|
2026-05-15 21:58:30 -05:00
|
|
|
}
|