// Module ID: 16962 // Function ID: 16963 // Name: MessageRequestRowSenderDetails // Dependencies: [19, 17, 4255, 21, 4607, 1178, 576, 504, 4451, 16963, 1399, 4603, 1114, 16964, 16965, 2] // Exports: default // Module 16962 (MessageRequestRowSenderDetails) import nativeDefault from "native" /* 576 */; import utils_AvatarUtilsDefault from "utils/AvatarUtils" /* 1399 */; import UserUtilsDefault from "UserUtils" /* 4451 */; import noop from "module_19" /* 19 */; import RelationshipStore from "RelationshipStore" /* 4255 */; const require = fn; const View = fn(17).View; const jsxProd = fn(21); ({ jsx: hasOwnProperty, jsxs: metroRequire, Fragment: closure_7 } = jsxProd); const createStyles = fn(4607); const obj2 = { avatar: { borderRadius: fn(1178).AVATAR_SIZE_MAP[fn(undefined, 1178).AvatarSizes.NORMAL] / 2, backgroundColor: nativeDefault.colors.BACKGROUND_SURFACE_HIGH }, avatarContainer: { marginRight: 16, alignItems: "flex-start", height: "100%" }, detailsContainer: { marginRight: 8, justifyContent: "flex-start", alignItems: "flex-start", flex: 1 }, messageDetails: { flexDirection: "row", alignItems: "center" }, username: null, timestampSeparator: null, messagePreview: null, usernameTextContainer: null }; let obj3 = { borderRadius: fn(1178).AVATAR_SIZE_MAP[fn(undefined, 1178).AvatarSizes.NORMAL] / 2, backgroundColor: nativeDefault.colors.BACKGROUND_SURFACE_HIGH }; obj2.username = { flexShrink: 1, color: nativeDefault.colors.MOBILE_TEXT_HEADING_PRIMARY }; obj2.timestampSeparator = { marginHorizontal: 6 }; obj2.messagePreview = { marginTop: 2 }; obj2.usernameTextContainer = { flexShrink: 1 }; let closure_8 = createStyles.createStyles(obj2); const size = fn(2); const result = size.fileFinishedImporting("modules/message_request/native/MessageRequestRowSenderDetails.tsx"); export default function MessageRequestRowSenderDetails(isRestricted) { ({ channel, otherUser } = isRestricted); let flag = isRestricted.isRestricted; if (flag === undefined) { flag = false; } const tmp = closure_8(); const items = [RelationshipStore]; const stateFromStores = otherUser(504).useStateFromStores(items, () => { let tmp2 = null; if (null != otherUser) { let nickname = RelationshipStore.getNickname(tmp.id); if (nickname == null) { nickname = UserUtilsDefault.getGlobalName(tmp); } tmp2 = nickname; } return tmp2; }); let obj = otherUser(504); const messageRequestRelativeTimestampText = otherUser(16963).useMessageRequestRelativeTimestampText(channel); const random = Math.random(); const rounded = Math.floor(random * utils_AvatarUtilsDefault.DEFAULT_AVATARS.length); const obj3 = { style: tmp.avatarContainer, children: null }; if (null != otherUser) { const obj4 = { avatarStyle: tmp.avatar, user: otherUser, guildId: "HermesInternal", disablePlaceholder: null, avatarDecoration: "Heartbeat" }; let avatarDecoration; if (otherUser != null) { avatarDecoration = otherUser.avatarDecoration; } obj4.avatarDecoration = avatarDecoration; let obj5 = obj4; } else { obj5 = { avatarStyle: tmp.avatar, source: utils_AvatarUtilsDefault.DEFAULT_AVATARS[rounded] }; } obj3.children = closure_5(otherUser(1178).Avatar, obj5); const items1 = [closure_5(View, obj3), ]; const obj6 = { style: tmp.detailsContainer, children: null }; const obj7 = { style: tmp.messageDetails, children: null }; const obj8 = { lineClamp: 1, variant: "text-md/semibold", color: "mobile-text-heading-primary", style: tmp.usernameTextContainer, children: null }; const obj9 = { variant: "text-md/semibold", color: "mobile-text-heading-primary", style: tmp.username, children: null }; let stringResult = stateFromStores; if (stateFromStores == null) { let username; if (otherUser != null) { username = otherUser.username; } stringResult = username; } if (stringResult == null) { const intl = tmp2(1114).intl; stringResult = intl.string(tmp2(1114).t["30mdIx"]); } obj9.children = stringResult; const items2 = [closure_5(otherUser(4603).Text, obj9), ]; let tmp9Result = null != stateFromStores; if (tmp9Result) { const obj10 = { variant: "text-md/medium", color: "text-muted", children: null }; const items3 = [" ", tmp2(4451).getUserTag(otherUser)]; obj10.children = items3; tmp9Result = tmp9(tmp2(4603).Text, obj10); const tmp2Result = tmp2(4451); } items2[1] = tmp9Result; obj8.children = items2; const items4 = [closure_6(otherUser(4603).Text, obj8), closure_5(otherUser(4603).Text, { style: tmp.timestampSeparator, variant: "text-xs/medium", color: "text-muted", children: "\u00B7" }), closure_5(otherUser(4603).Text, { variant: "text-xs/semibold", color: "text-muted", children: messageRequestRelativeTimestampText })]; obj7.children = items4; const items5 = [closure_6(View, obj7), , ]; let tmp11Result = !flag; if (!flag) { const obj12 = { style: tmp.messagePreview, channel }; tmp11Result = tmp11(tmp7(16964), obj12); } items5[1] = tmp11Result; if (flag) { flag = null != otherUser; } if (flag) { const obj13 = { style: tmp.messagePreview, userId: otherUser.id, suffix: null }; const intl2 = tmp2(1114).intl; obj13.suffix = intl2.string(tmp2(1114).t.hTltPn); flag = tmp11(tmp7(16965), obj13); const tmp7Result = tmp7(16965); } const obj14 = { children: null }; items5[2] = flag; obj6.children = items5; items1[1] = closure_6(View, obj6); obj14.children = items1; return closure_6(closure_7, obj14); };