Files
discord-decomp/modules/premium/game_server/hooks/useGameServerPerk.tsx
T
2026-11-01 12:12:55 +02:00

33 lines
1.6 KiB
TypeScript

// Metro module 11667 (f11668).
import { useMemo } from "react";
import GameServerStore from "../GameServerStore";
import { GuildPowerupType } from "../../powerups/constants/GuildPowerupsConstants";
import { GAME_SERVER_POWERUP_SKU_ID } from "../GameServerConstants";
import { useGameServerEnabled } from "../GameServerExperiment";
import { useStateFromStores } from "../../../../_bundle/Module589";
import useGameServerFeaturedGameNames from "./useGameServerFeaturedGameNames";
import { intl } from "../../../../intl/index.native";
import GameServer_messages from "../GameServer.messages";
import Module11669 from "../../../../_bundle/Module11669";
export default function useGameServerPerk(a0) {
let gameName, gameName2;
const gameServerEnabled = useGameServerEnabled(a0, "useGameServerPerk");
const stateFromStores = useStateFromStores([GameServerStore], () => GameServerStore.getLowestGameCostForGuild(a0));
const gameServerFeaturedGameNames = useGameServerFeaturedGameNames();
gameName = gameServerFeaturedGameNames.gameName;
gameName2 = gameServerFeaturedGameNames.gameName2;
return useMemo(() => gameServerEnabled ? stateFromStores != null ? {
skuId: GAME_SERVER_POWERUP_SKU_ID,
title: intl.string(GameServer_messages["B3OfL/"]),
description: intl.format(GameServer_messages["+UqyGU"], {
gameName,
gameName2
}),
cost: stateFromStores,
dependencies: [],
type: GuildPowerupType.PERK,
animatedImageUrl: Module11669,
staticImageUrl: Module11669
} : null : null, [gameServerEnabled, stateFromStores, gameName, gameName2]);
};