// Metro module 15855 (f15856). import { memo } from "react"; import { View } from "react-native"; import ChannelStore from "../../../../stores/ChannelStore"; import GuildStore from "../../../../stores/GuildStore"; import UserStore from "../../../../stores/UserStore"; import { InviteSendStates } from "../../../instant_invite/Constants"; import { createStyles } from "../../../../design/components/Styles/native/createStyles"; import Module712 from "../../../../_bundle/Module712"; import { useStateFromStores } from "../../../../_bundle/Module589"; import useChannelName from "../../../channel/useChannelName"; import { RowTypes } from "../../../../utils/InstantInviteUtils"; import { PressableOpacity } from "../../../../design/void/Pressables/native/Pressables"; import { Avatar, AvatarSizes } from "../../../../design/void/native"; import DiscordTag from "../../../user_profile/native/DiscordTag"; import UserUtils from "../../../../utils/UserUtils"; import { intl, t } from "../../../../intl/index.native"; import AvatarUtils from "../../../../utils/AvatarUtils"; import { getAcronym } from "../../../../utils/StringUtils"; import { Text } from "../../../../design/components/Text/native/Text"; import { TableRow } from "../../../../design/components/TableRow/native/TableRow.native"; import InviteButton from "../../../instant_invite/native/components/InviteButton"; const useStyles = createStyles({ acronym: { width: 32, height: 32, borderRadius: Module712.radii.lg, backgroundColor: Module712.colors.BACKGROUND_BASE_LOW, alignItems: "center", justifyContent: "center", overflow: "hidden", marginTop: 0, marginRight: 10, borderColor: Module712.colors.BORDER_MUTED, borderStyle: "solid", borderWidth: 2 } }); const r50 = memo(function ActivityInviteSheetRow(props) { let accessibilityActions, end, error, icon, isSubmitting, label, onAccessibilityAction, sendState, start; let onInviteSent, onPressAvatar, row, id; L31: { end = props.end; error = props.error; isSubmitting = props.isSubmitting; onInviteSent = props.onInviteSent; onPressAvatar = props.onPressAvatar; row = props.row; sendState = props.sendState; start = props.start; id = void 0; const styles = useStyles(); id = row.item.id; const stateFromStores = useStateFromStores([ChannelStore], () => ChannelStore.getChannel(id)); let r40 = useChannelName(stateFromStores); const type = row.type; if (RowTypes.DM !== type && RowTypes.FRIEND !== type) { if (RowTypes.GROUP_DM === type) { const r104 = stateFromStores != null ? : null; if (r40 == null) { r40 = ""; } label = r40; onAccessibilityAction = void 0; accessibilityActions = void 0; icon = r104; break L31; } if (RowTypes.CHANNEL === type) { const r25 = stateFromStores?.guild_id != null ? GuildStore.getGuild(stateFromStores.guild_id) : void 0; if (r25 == null) { return null; } icon = r25.icon != null ? : {getAcronym(r25.name)} ; label = r40 == null ? "" : `#${r40}`; onAccessibilityAction = void 0; accessibilityActions = void 0; break L31; } return null; } const user = UserStore.getUser(id); let source = user == null ? void 0 : user.getAvatarSource(void 0); if (source == null) { source = null; } const r146 = { event.stopPropagation(); if (onPressAvatar != null) { onPressAvatar(id); } }} style={{ padding: 8, margin: -8 }}> ; const r154 = ; const r156 = onPressAvatar != null ? [{ name: "viewProfile", label: intl.formatToPlainString(t.uCenkh, { username: user?.tag }) }] : void 0; onAccessibilityAction = (a0) => { if (a0.nativeEvent.actionName === "viewProfile" && onPressAvatar !== null && onPressAvatar != null) { onPressAvatar(id); } }; accessibilityActions = r156; label = r154; icon = r146; } const handlePress = function handlePress() { onInviteSent(row); }; return } onPress={handlePress} disabled={error != null || isSubmitting || sendState === InviteSendStates.SENT} accessibilityActions={accessibilityActions} onAccessibilityAction={onAccessibilityAction} />; }); export default r50;