Files
discord-decomp/modules/collectibles/profile_frames/hooks/useProfileFrame.tsx
T
2026-11-01 12:12:55 +02:00

18 lines
877 B
TypeScript

// Metro module 8094 (f8095).
import CollectiblesCategoryStore from "../../CollectiblesCategoryStore";
import CollectiblesPurchaseStore from "../../CollectiblesPurchaseStore";
import { isProfileFrameRecord } from "../../records/ProfileFrameRecord";
import { useStateFromStores } from "../../../../_bundle/Module589";
export default function useProfileFrame(c16244_0) {
return useStateFromStores([CollectiblesCategoryStore, CollectiblesPurchaseStore], () => {
if (c16244_0 != null) {
const product = CollectiblesCategoryStore.getProduct(c16244_0);
if (isProfileFrameRecord(product == null ? void 0 : product.items[0])) {
return product.items[0];
}
const purchase = CollectiblesPurchaseStore.getPurchase(c16244_0);
return isProfileFrameRecord(purchase == null ? void 0 : purchase.items[0]) ? purchase.items[0] : void 0;
}
});
};