decord/source/modules/premium/powerups/native/GuildPowerupsChannelRow.tsx
2026-07-30 10:14:41 +00:00

146 lines
5.2 KiB
TypeScript

// Module ID: 15177
// Function ID: 15178
// Name: GuildPowerupsChannelRowIndicator
// Dependencies: [19, 17, 10280, 21, 11583, 6727, 712, 1297, 4189, 15139, 14919, 5504, 11579, 11598, 11474, 11567, 5535, 1236, 2255, 15178, 11440, 2]
// Exports: default
// Module 15177 (GuildPowerupsChannelRowIndicator)
import BoostTier2Icon from "BoostTier2Icon";
import { View } from "getSystemLocale";
import jsxProd from "set";
import createCacheKey from "createCacheKey";
let c5;
let closure_6;
const require = arg1;
function GuildPowerupsChannelRowIndicator(indicator) {
indicator = indicator.indicator;
if (null == indicator) {
return null;
} else {
const type = indicator.type;
if (require(11583) /* GUILD_POWERUP_NOTIFICATION_COOLDOWN */.GuildPowerupNotificationIndicatorType.WARNING === type) {
let obj = { color: null, size: "sm" };
obj[0] = importDefault(712).colors.STATUS_WARNING;
return callback(tmp4(6727).CircleErrorIcon, obj);
} else if (tmp4(11583).GuildPowerupNotificationIndicatorType.UNREAD === type) {
obj = { value: null, isMentionLowImportance: true };
obj[0] = indicator.count;
return callback(tmp4(1297).Badge, obj);
} else {
return null;
}
}
}
function GuildPowerupsCoachmarkHost(arg0) {
let guildId;
let popout;
let targetRef;
({ targetRef, guildId, popout } = arg0);
importDefault(15139)(targetRef, guildId, popout);
return null;
}
function GuildPowerupsCoachmark(arg0) {
let guildId;
let popout;
let targetRef;
({ targetRef, guildId, popout } = arg0);
const context = React.useContext(require(14919) /* SidebarCoachmarkOverlayLayer */.SidebarCoachmarkOverlayContext);
const tmp5 = callback(GuildPowerupsCoachmarkHost, { targetRef, guildId, popout });
let tmp4Result = tmp5;
if (null != context) {
const obj = { value: null, children: null };
obj[0] = context;
obj[1] = tmp5;
tmp4Result = callback(require(5504) /* add */.LayerContext.Provider, obj);
}
return tmp4Result;
}
({ jsx: c5, jsxs: closure_6 } = jsxProd);
createCacheKey = { container: null };
createCacheKey = { marginVertical: require("hairlineWidth").CHANNEL_MARGIN_VERTICAL, marginHorizontal: 8, borderRadius: require("Themes").radii.md };
createCacheKey[0] = createCacheKey;
createCacheKey = createCacheKey.createStyles(createCacheKey);
const result = require("hairlineWidth").fileFinishedImporting("modules/premium/powerups/native/GuildPowerupsChannelRow.tsx");
export default function GuildPowerupsChannelRow(guildId) {
guildId = guildId.guildId;
let dismissNewBadgeIfShown;
let obj = React;
const ref = React.useRef(null);
const tmp5 = dismissNewBadgeIfShown(11579)(guildId);
let indicator;
const tmp = createCacheKey();
if (tmp5 != null) {
indicator = tmp5.indicator;
}
let tmp8 = null != indicator;
if (!tmp8) {
let popout;
if (tmp5 != null) {
popout = tmp5.popout;
}
tmp8 = null != popout;
}
const tmp6Result = dismissNewBadgeIfShown(11598)(guildId, tmp8);
dismissNewBadgeIfShown = tmp6Result.dismissNewBadgeIfShown;
let showUnread;
if (tmp5 != null) {
showUnread = tmp5.showUnread;
}
const ChannelModes = guildId(11474).ChannelModes;
if (true === showUnread) {
let DEFAULT = ChannelModes.UNREAD_IMPORTANT;
let tmp14 = tmp13;
} else {
DEFAULT = ChannelModes.DEFAULT;
tmp14 = tmp13;
}
const items = [guildId, dismissNewBadgeIfShown];
obj = { ref, collapsable: false, children: null };
obj = { targetRef: ref, guildId, popout: null };
let popout1;
const callback = obj.useCallback(() => {
dismissNewBadgeIfShown();
const obj = { guildId, analyticsLocation: null };
obj[1] = dismissNewBadgeIfShown(outer1_2[16]).GUILD_POWERUPS_CHANNEL_LIST_ROW;
dismissNewBadgeIfShown(outer1_2[15])(obj);
}, items);
if (tmp5 != null) {
popout1 = tmp5.popout;
}
obj[2] = popout1;
const items1 = [closure_5(GuildPowerupsCoachmark, obj), ];
const obj1 = { onPress: callback, style: tmp.container, accessible: true, mode: DEFAULT, unread: true === showUnread, accessibilityLabel: null, accessibilityState: null, name: null, icon: null, channelInfo: null };
const tmp16 = closure_6;
const tmp17 = View;
const tmp19 = GuildPowerupsCoachmark;
const tmp6 = dismissNewBadgeIfShown(11598);
const intl = tmp14(1236).intl;
obj1[5] = intl.string(dismissNewBadgeIfShown(2255).yv3DJJ);
obj1[6] = { selected: false };
const obj2 = { name: null, mode: null };
const intl2 = tmp14(1236).intl;
obj2[0] = intl2.string(dismissNewBadgeIfShown(2255).yv3DJJ);
obj2[1] = DEFAULT;
obj1[7] = closure_5(tmp14(11474).BaseChannelName, obj2);
const obj3 = { mode: DEFAULT, IconComponent: null };
obj3[1] = tmp14(15178).BoostTier2Icon;
obj1[8] = closure_5(tmp14(11474).BaseChannelIcon, obj3);
if (tmp6Result.showNewBadgeOnRow) {
let tmp18Result = tmp18(tmp14(11440).NewBadge, {});
} else {
let indicator1;
if (tmp5 != null) {
indicator1 = tmp5.indicator;
}
const obj4 = { indicator: null };
obj4[0] = indicator1;
tmp18Result = tmp18(GuildPowerupsChannelRowIndicator, obj4);
const tmp22 = GuildPowerupsChannelRowIndicator;
}
obj1[9] = tmp18Result;
items1[1] = closure_5(dismissNewBadgeIfShown(11474), obj1);
obj[2] = items1;
return tmp16(tmp17, obj);
};