decord/source/modules/icymi/native/ICYMIGuildEventRow.tsx

231 lines
9.4 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 15841
// Function ID: 15842
2026-07-20 16:05:17 +00:00
// Name: ICYMIGuildEventRow
2026-08-24 06:08:38 +00:00
// Dependencies: [19, 17, 4374, 1391, 1910, 21, 15777, 712, 8828, 1236, 8822, 4989, 8825, 8922, 9094, 8829, 7340, 8832, 15818, 11, 4739, 8924, 6922, 1297, 589, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 15841 (ICYMIGuildEventRow)
import ThemesDefault from "Themes" /* 712 */;
import closure_3 from "noop" /* 19 */;
import get_ActivityIndicator from "get ActivityIndicator" /* 17 */;
import scheduledEventSort from "scheduledEventSort" /* 4374 */;
import closure_8 from "scheduledEventSort" /* 4374 */;
import closure_9 from "ensureGuildLoaded" /* 1391 */;
import closure_10 from "createGuildRecordFromRust" /* 1910 */;
import jsxProd from "jsxProd" /* 21 */;
import createICYMIStyles from "createICYMIStyles" /* 15777 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function ICYMIGuildEventRow(event) {
event = event.event;
({ channel, guild } = event);
2026-08-24 06:08:38 +00:00
dependencyMap = undefined;
2026-07-20 16:05:17 +00:00
let React;
2026-07-29 08:29:29 +00:00
const tmp = callback4();
2026-08-24 06:08:38 +00:00
const tmp4 = guild(8828)(event, null);
2026-07-29 08:29:29 +00:00
const tmp5 = callback2(event);
dependencyMap = tmp5;
2026-07-20 16:05:17 +00:00
let toISOStringResult;
2026-07-29 08:29:29 +00:00
if (tmp4 != null) {
const startTime = tmp4.startTime;
2026-07-20 16:05:17 +00:00
toISOStringResult = startTime.toISOString();
}
React = toISOStringResult;
2026-07-29 08:29:29 +00:00
const items = [toISOStringResult, tmp5];
2026-08-24 06:08:38 +00:00
const tmp7 = guild(4989)(channel);
let obj = event(8825);
2026-08-06 08:05:19 +00:00
const locationFromEvent = obj.getLocationFromEvent(event);
2026-08-24 06:08:38 +00:00
obj1 = event(8922);
2026-08-06 08:05:19 +00:00
const eventLocationIconSource = obj1.getEventLocationIconSource(event, channel, true);
2026-08-24 06:08:38 +00:00
let obj2 = event(8922);
2026-08-06 08:05:19 +00:00
const eventLocationIconComponent = obj2.getEventLocationIconComponent(event, channel, true);
2026-08-24 06:08:38 +00:00
let obj3 = event(8822);
2026-07-20 16:05:17 +00:00
const items1 = [event];
2026-08-06 08:05:19 +00:00
const nextRecurrenceIdInEvent = obj3.getNextRecurrenceIdInEvent(event);
2026-07-20 16:05:17 +00:00
const items2 = [guild.id, event.id];
2026-08-06 08:05:19 +00:00
const callback = React.useCallback(() => {
2026-08-24 06:08:38 +00:00
let obj = guild(9094);
2026-07-20 16:05:17 +00:00
obj.itemInteracted(event.id, "guild_event", "press_event");
2026-07-23 10:11:24 +00:00
obj = { itemId: event.id, itemType: "guild_event", actionParameters: { actionGestureType: "press", actionTargetElement: "item_body", actionIntentType: "navigate", actionDestinationType: "event" } };
2026-08-24 06:08:38 +00:00
guild(9094).feedItemActioned(obj);
const obj2 = guild(9094);
2026-07-20 16:05:17 +00:00
obj = { eventId: event.id, event };
2026-08-24 06:08:38 +00:00
const result = event(8829).openGuildEventDetails(obj);
2026-07-20 16:05:17 +00:00
}, items1);
2026-08-06 08:05:19 +00:00
const callback1 = React.useCallback(() => {
2026-08-24 06:08:38 +00:00
let obj = guild(9094);
2026-07-20 16:05:17 +00:00
obj.itemInteracted(event.id, "guild_event", "press_event");
2026-07-23 10:11:24 +00:00
obj = { itemId: event.id, itemType: "guild_event", actionParameters: { actionGestureType: "press", actionTargetElement: "item_header", actionIntentType: "navigate", actionDestinationType: "guild" } };
2026-08-24 06:08:38 +00:00
guild(9094).feedItemActioned(obj);
const obj2 = guild(9094);
event(7340).transitionToGuild(guild.id);
2026-07-20 16:05:17 +00:00
}, items2);
let title = null != event.description;
if (title) {
title = event.description.length > 0;
}
let guild_id;
2026-08-24 06:08:38 +00:00
let tmp2Result = tmp2(8832);
2026-07-29 08:29:29 +00:00
if (event != null) {
2026-07-20 16:05:17 +00:00
guild_id = event.guild_id;
}
let id;
2026-07-29 08:29:29 +00:00
if (event != null) {
2026-07-20 16:05:17 +00:00
id = event.id;
}
2026-07-29 08:29:29 +00:00
obj = { actionLabel: null, id: null, interactionType: "guild_event", channelId: null, guildId: null, timestamp: null, onHeaderPress: null, onHeaderLongPress: null, children: null };
2026-08-24 06:08:38 +00:00
tmp2Result = tmp2(15818);
2026-07-29 08:29:29 +00:00
let intl = tmp8(1236).intl;
obj[0] = intl.string(event(1236).t["6pFsLQ"]);
obj[1] = event.id;
2026-07-20 16:05:17 +00:00
let id1;
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
id1 = channel.id;
}
2026-07-29 08:29:29 +00:00
obj[3] = id1;
obj[4] = guild.id;
const tmp2ResultResult = tmp2Result(guild_id, id, nextRecurrenceIdInEvent);
obj[5] = guild(11).extractTimestamp(event.id);
obj[6] = callback1;
obj[7] = callback1;
obj = { onPress: callback, style: tmp.container, children: null };
obj1 = { style: tmp.timeAndUserPillContainer, children: null };
2026-07-20 16:05:17 +00:00
let str = "text-brand";
2026-07-29 08:29:29 +00:00
if (tmp5) {
2026-07-20 16:05:17 +00:00
str = "status-positive";
}
2026-08-24 06:08:38 +00:00
obj1[1] = closure_11(event(4739).Text, {
2026-07-29 08:29:29 +00:00
variant: "text-sm/semibold",
color: str,
children: React.useMemo(() => {
2026-08-24 06:08:38 +00:00
if (dependencyMap) {
2026-07-29 08:29:29 +00:00
const obj = { startDateTimeString: null };
2026-08-24 06:08:38 +00:00
const intl = tmp(1236).intl;
obj[0] = intl.string(event(1236).t.TxqPQR);
2026-07-29 08:29:29 +00:00
let eventTimeData = obj;
} else {
2026-08-24 06:08:38 +00:00
eventTimeData = tmp(8822).getEventTimeData(c3);
const tmpResult = tmp(8822);
2026-07-29 08:29:29 +00:00
}
return eventTimeData;
}, items).startDateTimeString
});
const items3 = [closure_11(closure_5, obj1), , , , ];
2026-07-20 16:05:17 +00:00
if (title) {
title = tmp.title;
}
2026-08-06 08:05:19 +00:00
obj2 = { style: title, variant: "text-lg/semibold", children: event.name };
2026-08-24 06:08:38 +00:00
items3[1] = closure_11(event(4739).Text, obj2);
2026-08-06 08:05:19 +00:00
let tmp19Result = null != event.description;
if (tmp19Result) {
tmp19Result = event.description.length > 0;
2026-07-20 16:05:17 +00:00
}
2026-08-06 08:05:19 +00:00
if (tmp19Result) {
obj3 = { variant: "text-md/normal", color: "text-subtle", lineClamp: 5, children: null };
2026-08-24 06:08:38 +00:00
let tmp8Result = tmp8(8924);
2026-07-29 08:29:29 +00:00
const obj4 = { guildId: null };
obj4[0] = guild.id;
2026-08-06 08:05:19 +00:00
obj3[3] = tmp8Result.guildEventDetailsParser(event.description, true, obj4);
2026-08-24 06:08:38 +00:00
tmp19Result = tmp19(tmp8(4739).Text, obj3);
2026-07-20 16:05:17 +00:00
}
2026-08-06 08:05:19 +00:00
items3[2] = tmp19Result;
2026-07-29 08:29:29 +00:00
items3[3] = closure_11(closure_5, { style: tmp.separator });
const obj6 = { style: tmp.infoContainer, children: null };
const obj7 = { style: tmp.locationContainer, children: null };
2026-08-24 06:08:38 +00:00
const items4 = [closure_11(event(6922).GroupIcon, { size: "xs", style: tmp.eventsChannelIcon }), ];
2026-07-29 08:29:29 +00:00
const obj9 = { lineClamp: 1, variant: "text-xs/normal", color: "text-muted", children: null };
const intl2 = tmp8(1236).intl;
obj9[3] = intl2.format(event(1236).t["+DLsD8"], { count: tmp2ResultResult });
2026-08-24 06:08:38 +00:00
items4[1] = closure_11(event(4739).Text, obj9);
2026-07-29 08:29:29 +00:00
obj7[1] = items4;
const items5 = [closure_12(closure_5, obj7), ];
const obj10 = { style: tmp.locationContainer, children: null };
2026-07-20 16:05:17 +00:00
if (null != eventLocationIconComponent) {
2026-07-29 08:29:29 +00:00
const obj11 = { size: "xs", style: null };
obj11[1] = tmp.eventsChannelIcon;
2026-08-06 08:05:19 +00:00
tmp19Result = tmp19(eventLocationIconComponent, obj11);
2026-07-20 16:05:17 +00:00
} else {
2026-08-06 08:05:19 +00:00
tmp19Result = null != eventLocationIconSource;
if (tmp19Result) {
2026-07-29 08:29:29 +00:00
const obj12 = { source: null, size: null, style: null, disableColor: true };
obj12[0] = eventLocationIconSource;
obj12[1] = tmp8(1297).Icon.Sizes.EXTRA_SMALL;
obj12[2] = tmp.eventsChannelIcon;
2026-08-06 08:05:19 +00:00
tmp19Result = tmp19(tmp8(1297).Icon, obj12);
2026-07-20 16:05:17 +00:00
}
}
2026-08-06 08:05:19 +00:00
const items6 = [tmp19Result, ];
let tmp27 = tmp7;
if (tmp7 == null) {
let result = null;
if (null != locationFromEvent) {
2026-08-24 06:08:38 +00:00
tmp8Result = tmp8(8924);
2026-08-06 08:05:19 +00:00
result = tmp8Result.guildEventLocationParser(locationFromEvent, true);
}
tmp27 = result;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
items6[1] = closure_11(event(4739).Text, { lineClamp: 2, variant: "text-xs/normal", color: "text-muted", children: tmp27 });
2026-07-29 08:29:29 +00:00
obj10[1] = items6;
items5[1] = closure_12(closure_5, obj10);
obj6[1] = items5;
items3[4] = closure_12(closure_5, obj6);
obj[2] = items3;
obj[8] = closure_12(closure_4, obj);
return closure_11(tmp2Result, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
({ Pressable: c4, View: c5 } = get_ActivityIndicator);
({ isGuildEventEnded: closure_6, isGuildScheduledEventActive: error } = scheduledEventSort);
({ jsx: unpackModuleId, jsxs: closure_12 } = jsxProd);
2026-07-23 10:11:24 +00:00
let closure_13 = createICYMIStyles.createICYMIStyles((margin) => {
2026-07-29 08:29:29 +00:00
obj = { container: obj, card: null, title: null, timeAndUserPillContainer: null, separator: null, eventsChannelIcon: null, infoContainer: null, locationContainer: null };
2026-07-20 16:05:17 +00:00
obj = { marginHorizontal: margin.margin, marginBottom: margin.margin, marginLeft: margin.margin + margin.inset };
2026-08-24 06:08:38 +00:00
obj = { marginTop: ThemesDefault.space.PX_12 };
2026-07-29 08:29:29 +00:00
obj[1] = obj;
2026-08-24 06:08:38 +00:00
obj[2] = { marginBottom: ThemesDefault.space.PX_4 };
obj1 = { marginBottom: ThemesDefault.space.PX_4 };
obj[3] = { flexDirection: "row", alignItems: "center", marginBottom: ThemesDefault.space.PX_8, justifyContent: "space-between" };
const obj2 = { flexDirection: "row", alignItems: "center", marginBottom: ThemesDefault.space.PX_8, justifyContent: "space-between" };
obj[4] = { height: 1, width: "100%", backgroundColor: ThemesDefault.colors.BORDER_SUBTLE, marginVertical: ThemesDefault.space.PX_12 };
const obj3 = { height: 1, width: "100%", backgroundColor: ThemesDefault.colors.BORDER_SUBTLE, marginVertical: ThemesDefault.space.PX_12 };
obj[5] = { tintColor: ThemesDefault.colors.INTERACTIVE_TEXT_DEFAULT };
const obj4 = { tintColor: ThemesDefault.colors.INTERACTIVE_TEXT_DEFAULT };
obj[6] = { gap: ThemesDefault.space.PX_4 };
const obj5 = { gap: ThemesDefault.space.PX_4 };
obj[7] = { alignItems: "center", flexDirection: "row", gap: ThemesDefault.space.PX_8 };
2026-07-20 16:05:17 +00:00
return obj;
});
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("modules/icymi/native/ICYMIGuildEventRow.tsx");
2026-07-20 16:05:17 +00:00
export default function ICYMIGuildEventRowWrapper(eventId) {
2026-07-23 10:11:24 +00:00
eventId = eventId.eventId;
2026-07-29 08:29:29 +00:00
let stateFromStores;
let obj = eventId(589);
2026-07-20 16:05:17 +00:00
const items = [closure_8];
2026-08-24 06:08:38 +00:00
stateFromStores = obj.useStateFromStores(items, () => closure_1_8.getGuildScheduledEvent(eventId));
const items1 = [closure_10];
2026-07-29 08:29:29 +00:00
const stateFromStores1 = eventId(589).useStateFromStores(items1, () => {
2026-07-20 16:05:17 +00:00
let guild_id;
2026-07-29 08:29:29 +00:00
if (stateFromStores != null) {
2026-07-20 16:05:17 +00:00
guild_id = stateFromStores.guild_id;
}
2026-08-24 06:08:38 +00:00
return closure_1_10.getGuild(guild_id);
2026-07-20 16:05:17 +00:00
});
2026-07-29 08:29:29 +00:00
eventId(589);
2026-08-24 06:08:38 +00:00
[][0] = closure_9;
2026-07-20 16:05:17 +00:00
let tmp5 = null;
if (null != stateFromStores) {
tmp5 = null;
if (null != stateFromStores1) {
tmp5 = null;
if (!callback(stateFromStores)) {
2026-07-29 08:29:29 +00:00
obj = { event: null, channel: null, guild: null };
obj[0] = stateFromStores;
obj[1] = tmp4;
obj[2] = stateFromStores1;
2026-07-20 16:05:17 +00:00
tmp5 = callback3(ICYMIGuildEventRow, obj);
}
}
}
return tmp5;
};