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

63 lines
2 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 11737
// Function ID: 11738
2026-07-20 16:05:17 +00:00
// Name: useCalculatePowerupCardStatus
2026-08-24 06:08:38 +00:00
// Dependencies: [19, 4266, 1236, 2368, 2]
2026-07-20 16:05:17 +00:00
// Exports: useCalculatePowerupCardStatus
2026-08-24 06:08:38 +00:00
// Module 11737 (useCalculatePowerupCardStatus)
import closure_3 from "noop" /* 19 */;
import { PowerupActiveStatusType } from "BoostedGuildTiers" /* 4266 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/premium/powerups/utils/useCalculatePowerupCardStatus.tsx");
2026-07-20 16:05:17 +00:00
export const useCalculatePowerupCardStatus = function useCalculatePowerupCardStatus(powerup, arg1, arg2) {
2026-08-24 06:08:38 +00:00
closure_0 = powerup;
closure_1 = arg1;
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;
2026-07-29 08:29:29 +00:00
if (sourceEntitlement != null) {
2026-07-20 16:05:17 +00:00
ends_at = sourceEntitlement.ends_at;
}
if (null != ends_at) {
2026-07-29 08:29:29 +00:00
let obj = { type: "expiring", expiringAt: null };
obj[1] = tmp.sourceEntitlement.ends_at;
let tmp5 = obj;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
if (dependencyMap) {
if (null != powerup.storeRemovalDate) {
2026-07-29 08:29:29 +00:00
obj = { type: "removing", removingAt: null };
obj[1] = tmp3.storeRemovalDate;
tmp5 = obj;
2026-07-20 16:05:17 +00:00
}
}
2026-08-24 06:08:38 +00:00
if (tmp.type === closure_1_4.LEVEL_ACTIVATED) {
2026-07-29 08:29:29 +00:00
const intl2 = powerup(1236).intl;
const sourcePowerup = tmp.sourcePowerup;
2026-07-20 16:05:17 +00:00
let title;
2026-07-29 08:29:29 +00:00
if (sourcePowerup != null) {
2026-07-20 16:05:17 +00:00
title = sourcePowerup.title;
}
2026-07-29 08:29:29 +00:00
if (title == null) {
const intl3 = tmp9(1236).intl;
title = intl3.string(tmp9(1236).t.BfF6ED);
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
obj1 = { type: "active", statusText: null };
2026-07-29 08:29:29 +00:00
const obj2 = { perkName: null };
obj2[0] = title;
2026-08-24 06:08:38 +00:00
obj1[1] = intl2.formatToPlainString(lib(2368).WRRYUT, obj2);
2026-07-29 08:29:29 +00:00
tmp5 = obj1;
} else if (tmp.type !== tmp4.INACTIVE) {
obj = { type: "active", statusText: null };
const intl = powerup(1236).intl;
2026-08-24 06:08:38 +00:00
obj[1] = intl.string(lib(2368).FFLkmx);
2026-07-29 08:29:29 +00:00
tmp5 = obj;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
return tmp5;
2026-07-20 16:05:17 +00:00
}, items);
};