// Metro module 10337 (f10338). import { useMemo } from "react"; import { View } from "react-native"; import AccessibilityStore from "../../a11y/AccessibilityStore"; import RelationshipStore from "../../../stores/RelationshipStore"; import UserStore from "../../../stores/UserStore"; import { createStyles } from "../../../design/components/Styles/native/createStyles"; import Module712 from "../../../_bundle/Module712"; import { Text } from "../../../design/components/Text/native/Text"; import { computeChannelName } from "../../channel/useChannelName"; import { ChannelTypesSets, ChannelTypes } from "../../../_bundle/Module692"; import { ChatIcon } from "../../../design/components/Icon/native/redesign/generated/ChatIcon"; import { ThreadIcon } from "../../../design/components/Icon/native/redesign/generated/ThreadIcon"; import { getSimpleChannelIconComponent } from "../../../utils/native/ChannelUtils"; import { useStateFromStores } from "../../../_bundle/Module589"; import { PressableOpacity } from "../../../design/void/Pressables/native/Pressables"; import { intl, t } from "../../../intl/index.native"; import { XSmallIcon } from "../../../design/components/Icon/native/redesign/generated/XSmallIcon"; let androidRippleConfig, hitSlop, useStyles; const LocationText = function LocationText(props) { const { channel, parentChannel, author, location: location2 } = props; let color2 = props.color; const styles = useStyles(); if (color2 == null) { color2 = "text-muted"; } const color = color2; return {author != null && ·} {useMemo(() => { const Component = ChannelTypesSets.PRIVATE_CHANNEL.has(channel.type) ? void 0 : channel.type === ChannelTypes.PUBLIC_THREAD ? parentChannel != null && parentChannel.type === ChannelTypes.GUILD_FORUM ? ChatIcon : ThreadIcon : getSimpleChannelIconComponent(channel); return Component != null ? : null; }, [channel, parentChannel, styles.icon, color])} {location2} ; }; androidRippleConfig = Object.freeze({ radius: 12 }); hitSlop = Object.freeze({ top: 8, right: 8, bottom: 8, left: 8 }); useStyles = createStyles({ container: { flexDirection: "row", alignItems: "center", gap: Module712.space.PX_8 }, headerContent: { flex: 1, flexDirection: "row", alignItems: "center" }, primaryText: { flexShrink: 1, marginRight: 2 }, secondaryTextContainer: { flexDirection: "row", alignItems: "center", gap: 2, flex: 1, overflow: "hidden" }, separator: { marginHorizontal: 2 }, icon: { width: 16, height: 16 }, secondaryText: { flex: 1 } }); export default function MessageNotificationHeader(props) { let location2; const { channel: channel2, parentChannel: parentChannel2, guild, author } = props; let expanded = props.expanded; const { onDismiss, locationTextColor } = props; const styles2 = useStyles(); const stateFromStores = useStateFromStores([AccessibilityStore], () => AccessibilityStore.roleStyle); const colorString = author?.colorString; const color2 = stateFromStores === "username" ? colorString : void 0; const r23 = color2 != null ? { color: color2 } : void 0; L24: { const r10 = computeChannelName(channel2, UserStore, RelationshipStore); const type = channel2.type; const GROUP_DM = ChannelTypes.GROUP_DM; location2 = r10; if (GROUP_DM !== type) { if (ChannelTypes.GUILD_FORUM !== type && ChannelTypes.GUILD_TEXT !== type && ChannelTypes.GUILD_ANNOUNCEMENT !== type) { if (ChannelTypes.ANNOUNCEMENT_THREAD !== type && ChannelTypes.PUBLIC_THREAD !== type) { const PRIVATE_THREAD = ChannelTypes.PRIVATE_THREAD; location2 = null; if (PRIVATE_THREAD !== type) { break L24; } } const r15 = parentChannel2 != null ? computeChannelName(parentChannel2, UserStore, RelationshipStore) : null; location2 = r15 != null ? `${r10}, ${r15}` : guild != null ? `${r10}, ${guild.name}` : r10; break L24; } location2 = guild != null ? `${r10}, ${guild.name}` : null; } } const r112 = [ {author != null && {author.nick}} {location2 != null && } , ,]; if (expanded) { expanded = onDismiss != null; } if (expanded) { expanded = onDismiss("close_from_expanded")}> ; } r112[1] = expanded; return {r112}; }; export function SimpleNotificationHeader(props) { const { text, secondaryText, labelStyle } = props; const styles2 = useStyles(); return {text} {secondaryText != null && · {secondaryText} } ; }