// Metro module 15386 (f15387). import { useMemo, useCallback } from "react"; import { Pressable, View } from "react-native"; import GuildScheduledEventStore, { isGuildEventEnded, isGuildScheduledEventActive } from "../../guild_scheduled_events/GuildScheduledEventStore"; import ChannelStore from "../../../stores/ChannelStore"; import GuildStore from "../../../stores/GuildStore"; import { createICYMIStyles } from "./createICYMIStyles"; import Module712 from "../../../_bundle/Module712"; import useEventSchedule from "../../guild_scheduled_events/useEventSchedule"; import { intl, t } from "../../../intl/index.native"; import { getEventTimeData, getNextRecurrenceIdInEvent } from "../../guild_scheduled_events/utils/ScheduleUtils"; import useChannelName from "../../channel/useChannelName"; import { getLocationFromEvent } from "../../guild_scheduled_events/utils/EntityUtils"; import { getEventLocationIconSource, getEventLocationIconComponent } from "../../guild_scheduled_events/native/components/GuildEventUtils"; import ICYMIActionCreators from "../ICYMIActionCreators"; import { openGuildEventDetails } from "../../guild_scheduled_events/GuildScheduledEventModalActionCreators.native"; import { transitionToGuild } from "../../routing/transitionToGuild.native"; import useGuildScheduledEventUserCount from "../../guild_scheduled_events/useGuildScheduledEventUserCount"; import ICYMICardInCard from "./ICYMICardInCard"; import SnowflakeUtils from "../../../utils/SnowflakeUtils"; import { Text } from "../../../design/components/Text/native/Text"; import { guildEventDetailsParser } from "../../guild_scheduled_events/guildEventDetailsParser.native"; import { GroupIcon } from "../../../design/components/Icon/native/redesign/generated/GroupIcon"; import { Icon } from "../../../design/void/native"; import { useStateFromStores } from "../../../_bundle/Module589"; let styles; const ICYMIGuildEventRow = function ICYMIGuildEventRow(props) { const { event, channel, guild } = props; const r22 = styles(); const eventSchedule = useEventSchedule(event, null); const isGuildScheduledEventActive2 = isGuildScheduledEventActive(event); const r33 = eventSchedule == null ? void 0 : eventSchedule.startTime.toISOString(); let c21944_3 = r33; const startDateTimeString = useMemo(() => isGuildScheduledEventActive2 ? { startDateTimeString: intl.string(t.TxqPQR) } : getEventTimeData(c21944_3), [r33, isGuildScheduledEventActive2]).startDateTimeString; let r21 = useChannelName(channel); const locationFromEvent = getLocationFromEvent(event); if (r21 == null) { r21 = locationFromEvent; } const eventLocationIconSource = getEventLocationIconSource(event, channel, true); const EventLocationIconComponent = getEventLocationIconComponent(event, channel, true); const nextRecurrenceIdInEvent = getNextRecurrenceIdInEvent(event); const callback = useCallback(() => { ICYMIActionCreators.itemInteracted(event.id, "guild_event", "press_event"); ICYMIActionCreators.feedItemActioned({ itemId: event.id, itemType: "guild_event", actionParameters: { actionGestureType: "press", actionTargetElement: "item_body", actionIntentType: "navigate", actionDestinationType: "event" } }); openGuildEventDetails({ eventId: event.id, event }); }, [event]); const callback2 = useCallback(() => { ICYMIActionCreators.itemInteracted(event.id, "guild_event", "press_event"); ICYMIActionCreators.feedItemActioned({ itemId: event.id, itemType: "guild_event", actionParameters: { actionGestureType: "press", actionTargetElement: "item_header", actionIntentType: "navigate", actionDestinationType: "guild" } }); transitionToGuild(guild.id); }, [guild.id, event.id]); let style = event.description != null && event.description.length > 0; const guildScheduledEventUserCount = useGuildScheduledEventUserCount(event?.guild_id, event?.id, nextRecurrenceIdInEvent); const props2 = { actionLabel: intl.string(t["6pFsLQ"]), id: event.id, interactionType: "guild_event", channelId: channel?.id, guildId: guild.id, timestamp: SnowflakeUtils.extractTimestamp(event.id), onHeaderPress: callback2, onHeaderLongPress: callback2, children: null }; const r107 = [ {startDateTimeString} , , , , ,]; if (style) { style = r22.title; } r107[1] = {event.name}; r107[2] = event.description != null && event.description.length > 0 && {guildEventDetailsParser(event.description, true, { guildId: guild.id })} ; r107[3] = ; r107[4] = {intl.format(t["+DLsD8"], { count: guildScheduledEventUserCount })} {EventLocationIconComponent != null ? : eventLocationIconSource != null && } {r21 != null ? guildEventDetailsParser(r21, true) : null} ; props2.children = {r107}; return ; }; styles = createICYMIStyles((a0) => ({ container: { marginHorizontal: a0.margin, marginBottom: a0.margin, marginLeft: a0.margin + a0.inset }, card: { marginTop: Module712.space.PX_12 }, title: { marginBottom: Module712.space.PX_4 }, timeAndUserPillContainer: { flexDirection: "row", alignItems: "center", marginBottom: Module712.space.PX_8, justifyContent: "space-between" }, separator: { height: 1, width: "100%", backgroundColor: Module712.colors.BORDER_SUBTLE, marginVertical: Module712.space.PX_12 }, eventsChannelIcon: { tintColor: Module712.colors.INTERACTIVE_TEXT_DEFAULT }, infoContainer: { gap: Module712.space.PX_4 }, locationContainer: { alignItems: "center", flexDirection: "row", gap: Module712.space.PX_8 } })); export default function ICYMIGuildEventRowWrapper(props) { const eventId = props.eventId; const stateFromStores = useStateFromStores([GuildScheduledEventStore], () => GuildScheduledEventStore.getGuildScheduledEvent(eventId)); const stateFromStores2 = useStateFromStores([GuildStore], () => GuildStore.getGuild(stateFromStores?.guild_id)); const stateFromStores3 = useStateFromStores([ChannelStore], () => ChannelStore.getChannel(stateFromStores?.channel_id)); return stateFromStores == null ? null : stateFromStores2 == null ? null : isGuildEventEnded(stateFromStores) ? null : ; };