decord/source/modules/premium/powerups/utils/useCalculatePowerupCardStatus.tsx

61 lines
2 KiB
TypeScript
Raw Normal View History

2026-07-27 11:26:19 +00:00
// Module ID: 11548
// Function ID: 89904
2026-07-20 16:05:17 +00:00
// Name: useCalculatePowerupCardStatus
2026-07-25 08:10:48 +00:00
// Dependencies: [31, 4019, 1212, 2231, 2]
2026-07-20 16:05:17 +00:00
// Exports: useCalculatePowerupCardStatus
2026-07-27 11:26:19 +00:00
// Module 11548 (useCalculatePowerupCardStatus)
2026-07-23 10:11:24 +00:00
import result from "result";
import { PowerupActiveStatusType } from "BoostedGuildTiers";
const require = arg1;
const result = require("getSystemLocale").fileFinishedImporting("modules/premium/powerups/utils/useCalculatePowerupCardStatus.tsx");
2026-07-20 16:05:17 +00:00
export const useCalculatePowerupCardStatus = function useCalculatePowerupCardStatus(powerup, arg1, arg2) {
2026-07-23 10:11:24 +00:00
let closure_0 = powerup;
let closure_1 = arg1;
let closure_2 = arg2;
2026-07-20 16:05:17 +00:00
const items = [arg1, arg2, powerup];
2026-07-23 10:11:24 +00:00
return React.useMemo(() => {
const sourceEntitlement = lib.sourceEntitlement;
2026-07-20 16:05:17 +00:00
let ends_at;
if (null != sourceEntitlement) {
ends_at = sourceEntitlement.ends_at;
}
if (null != ends_at) {
2026-07-23 10:11:24 +00:00
let obj = { type: "expiring", expiringAt: lib.sourceEntitlement.ends_at };
2026-07-20 16:05:17 +00:00
let tmp7 = obj;
} else {
2026-07-23 10:11:24 +00:00
if (dependencyMap) {
if (null != powerup.storeRemovalDate) {
obj = { type: "removing", removingAt: powerup.storeRemovalDate };
2026-07-20 16:05:17 +00:00
tmp7 = obj;
}
}
2026-07-23 10:11:24 +00:00
if (lib.type === outer1_4.LEVEL_ACTIVATED) {
2026-07-20 16:05:17 +00:00
const obj1 = { type: "active" };
2026-07-23 10:11:24 +00:00
const intl2 = powerup(1212).intl;
2026-07-20 16:05:17 +00:00
const obj2 = {};
2026-07-23 10:11:24 +00:00
const sourcePowerup = lib.sourcePowerup;
2026-07-20 16:05:17 +00:00
let title;
if (null != sourcePowerup) {
title = sourcePowerup.title;
}
if (null == title) {
2026-07-23 10:11:24 +00:00
const intl3 = powerup(1212).intl;
title = intl3.string(powerup(1212).t.BfF6ED);
2026-07-20 16:05:17 +00:00
}
obj2.perkName = title;
2026-07-25 08:10:48 +00:00
obj1.statusText = intl2.formatToPlainString(lib(2231).WRRYUT, obj2);
2026-07-20 16:05:17 +00:00
tmp7 = obj1;
2026-07-23 10:11:24 +00:00
} else if (lib.type !== outer1_4.INACTIVE) {
2026-07-20 16:05:17 +00:00
obj = { type: "active" };
2026-07-23 10:11:24 +00:00
const intl = powerup(1212).intl;
2026-07-25 08:10:48 +00:00
obj.statusText = intl.string(lib(2231).FFLkmx);
2026-07-20 16:05:17 +00:00
tmp7 = obj;
}
}
return tmp7;
}, items);
};