decord/source/modules/share/native/DestinationFailedAlertModal.tsx

184 lines
7.3 KiB
TypeScript
Raw Normal View History

2026-08-06 08:05:19 +00:00
// Module ID: 10185
// Function ID: 10186
2026-07-20 16:05:17 +00:00
// Name: FailedGroupDMRow
2026-08-06 08:05:19 +00:00
// Dependencies: [19, 17, 1372, 1891, 4371, 3921, 1903, 505, 21, 4285, 712, 4475, 9582, 1297, 4281, 589, 4123, 10186, 4628, 4628, 1236, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-06 08:05:19 +00:00
// Module 10185 (FailedGroupDMRow)
2026-07-29 08:29:29 +00:00
import "getAlertModalItemKey";
import { View } from "GuildIconWithChannelTypeSizes";
import ensureGuildLoaded from "ensureGuildLoaded";
import createGuildRecordFromRust from "createGuildRecordFromRust";
import sortActivity from "sortActivity";
import upsertRelationship from "upsertRelationship";
import mergeGuildAvatar from "mergeGuildAvatar";
2026-07-23 10:11:24 +00:00
import { StatusTypes } from "sum";
2026-07-29 08:29:29 +00:00
import jsxProd from "set";
import createCacheKey from "createCacheKey";
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let c10;
2026-07-23 10:11:24 +00:00
let closure_12;
2026-07-29 08:29:29 +00:00
let unpackModuleId;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function FailedGroupDMRow(channel) {
channel = channel.channel;
2026-07-29 08:29:29 +00:00
const tmp = createCacheKey();
let obj = { style: tmp.row, children: null };
obj = { size: null, channel: null };
2026-08-06 08:05:19 +00:00
const tmp2 = importDefault(4475)(channel);
2026-07-29 08:29:29 +00:00
obj[0] = require(1297) /* Button */.AvatarSizes.REFRESH_MEDIUM_32;
obj[1] = channel;
2026-08-06 08:05:19 +00:00
const items = [callback(importDefault(9582), obj), ];
2026-07-23 10:11:24 +00:00
obj = { style: tmp.label, variant: "text-md/medium", lineClamp: 1, ellipsizeMode: "tail", children: tmp2 };
2026-08-06 08:05:19 +00:00
items[1] = callback(require(4281) /* Text */.Text, obj);
2026-07-29 08:29:29 +00:00
obj[1] = items;
2026-07-20 16:05:17 +00:00
return callback2(View, obj);
}
function FailedUserRow(user) {
user = user.user;
2026-07-29 08:29:29 +00:00
const tmp = createCacheKey();
let obj = user(589);
const items = [upsertRelationship];
2026-07-23 10:11:24 +00:00
let stateFromStores = obj.useStateFromStores(items, () => outer1_7.getNickname(user.id));
2026-07-29 08:29:29 +00:00
let obj1 = user(589);
const items1 = [sortActivity];
2026-07-23 10:11:24 +00:00
const stateFromStoresObject = obj1.useStateFromStoresObject(items1, () => ({ isMobileOnline: outer1_6.isMobileOnline(user.id), status: outer1_6.getStatus(user.id), isVROnline: outer1_6.isVROnline(user.id) }));
2026-07-20 16:05:17 +00:00
const status = stateFromStoresObject.status;
2026-07-29 08:29:29 +00:00
let tmp9Result = null;
2026-07-20 16:05:17 +00:00
if (null != user) {
2026-07-29 08:29:29 +00:00
obj = { style: null, children: null };
obj[0] = tmp.row;
2026-08-05 07:35:12 +00:00
obj = { user: null, guildId: "Boolean", status: true, isMobileOnline: null, isVROnline: null, size: null, avatarDecoration: null, autoStatusCutout: "%d\u00BA" };
2026-07-29 08:29:29 +00:00
obj[0] = user;
2026-07-20 16:05:17 +00:00
let tmp13 = null;
if (StatusTypes.OFFLINE !== status) {
tmp13 = status;
}
2026-07-29 08:29:29 +00:00
obj[2] = tmp13;
obj[3] = tmp6;
obj[4] = tmp7;
obj[5] = tmp2(1297).AvatarSizes.XSMALL;
obj[6] = user.avatarDecoration;
const items2 = [closure_10(tmp2(1297).Avatar, obj), ];
obj1 = { style: null, variant: "text-md/medium", lineClamp: 1, ellipsizeMode: "tail", children: null };
obj1[0] = tmp.label;
if (stateFromStores == null) {
2026-08-06 08:05:19 +00:00
stateFromStores = importDefault(4123).getName(user);
const obj6 = importDefault(4123);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj1[4] = stateFromStores;
2026-08-06 08:05:19 +00:00
items2[1] = closure_10(tmp2(4281).Text, obj1);
2026-07-29 08:29:29 +00:00
obj[1] = items2;
tmp9Result = closure_11(View, obj);
const tmp10 = View;
const tmp9 = closure_11;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp9Result;
2026-07-20 16:05:17 +00:00
}
function FailedChannelRow(channel) {
channel = channel.channel;
2026-07-29 08:29:29 +00:00
const tmp = createCacheKey();
let obj = channel(589);
const items = [createGuildRecordFromRust];
2026-07-20 16:05:17 +00:00
const stateFromStores = obj.useStateFromStores(items, () => {
let guild_id;
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
guild_id = channel.guild_id;
}
2026-07-23 10:11:24 +00:00
return outer1_5.getGuild(guild_id);
2026-07-20 16:05:17 +00:00
});
2026-07-29 08:29:29 +00:00
obj = { style: tmp.row, children: null };
obj = { "aria-label": "", guild: stateFromStores, channel, size: null };
2026-08-06 08:05:19 +00:00
obj[3] = channel(10186).GuildIconWithChannelTypeSizes.SMALL_32;
const items1 = [callback(channel(10186).GuildIconWithChannelType, obj), ];
const tmp3 = importDefault(4475)(channel);
items1[1] = callback(channel(4281).Text, { style: tmp.label, variant: "text-md/medium", lineClamp: 1, ellipsizeMode: "tail", children: importDefault(4475)(channel) });
2026-07-29 08:29:29 +00:00
obj[1] = items1;
2026-07-20 16:05:17 +00:00
return callback2(View, obj);
}
function FailedDestinationRow(destination) {
let channel;
let user;
2026-07-23 10:11:24 +00:00
destination = destination.destination;
2026-07-29 08:29:29 +00:00
let obj = destination(589);
const items = [ensureGuildLoaded, mergeGuildAvatar];
2026-07-20 16:05:17 +00:00
const stateFromStoresObject = obj.useStateFromStoresObject(items, () => {
let channel = null;
if ("channel" === destination.type) {
2026-07-29 08:29:29 +00:00
channel = outer1_4.getChannel(tmp.id);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const obj = { channel, user: null };
2026-07-20 16:05:17 +00:00
let user = null;
if ("user" === destination.type) {
2026-07-29 08:29:29 +00:00
user = outer1_8.getUser(tmp.id);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[1] = user;
2026-07-20 16:05:17 +00:00
return obj;
});
({ channel, user } = stateFromStoresObject);
2026-07-29 08:29:29 +00:00
let isGroupDMResult;
if (channel != null) {
isGroupDMResult = channel.isGroupDM();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (isGroupDMResult) {
obj = { channel: null };
obj[0] = channel;
let tmp3 = callback(FailedGroupDMRow, obj);
} else if (null != user) {
obj = { user: null };
obj[0] = user;
tmp3 = callback(FailedUserRow, obj);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
tmp3 = null;
2026-07-20 16:05:17 +00:00
if (null != channel) {
2026-07-29 08:29:29 +00:00
const obj1 = { channel: null };
obj1[0] = channel;
tmp3 = callback(FailedChannelRow, obj1);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
return tmp3;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
({ jsx: c10, jsxs: unpackModuleId, Fragment: closure_12 } = jsxProd);
createCacheKey = { container: null, row: null, label: null };
createCacheKey = { borderWidth: 1, borderColor: require("Themes").colors.BORDER_STRONG, borderRadius: require("Themes").radii.lg, paddingVertical: require("Themes").space.PX_8 };
createCacheKey[0] = createCacheKey;
createCacheKey[1] = { display: "flex", flexDirection: "row", alignItems: "center", gap: require("Themes").space.PX_12, height: 40, marginHorizontal: require("Themes").space.PX_16 };
createCacheKey[2] = { flexShrink: 1 };
createCacheKey = createCacheKey.createStyles(createCacheKey);
let obj1 = { display: "flex", flexDirection: "row", alignItems: "center", gap: require("Themes").space.PX_12, height: 40, marginHorizontal: require("Themes").space.PX_16 };
const result = require("ensureGuildLoaded").fileFinishedImporting("modules/share/native/DestinationFailedAlertModal.tsx");
2026-07-20 16:05:17 +00:00
export default function DestinationFailedAlertModal(arg0) {
let content;
let failedDestinations;
let onRetry;
let title;
({ failedDestinations, onRetry } = arg0);
({ title, content } = arg0);
2026-07-29 08:29:29 +00:00
let obj = { title, content, extraContent: null, actions: null };
obj = { style: createCacheKey().container, children: null };
obj[1] = failedDestinations.map((destination) => callback(closure_17, { destination }, arg1));
obj[2] = callback(View, obj);
2026-07-20 16:05:17 +00:00
if (null != onRetry) {
2026-07-29 08:29:29 +00:00
obj = { children: null };
const obj1 = { variant: "primary", onPress: null, text: null };
obj1[1] = onRetry;
const intl2 = tmp3(1236).intl;
obj1[2] = intl2.string(tmp3(1236).t["5911Lb"]);
2026-08-06 08:05:19 +00:00
const items = [tmp2(tmp3(4628).AlertActionButton, obj1, "confirm"), ];
2026-07-29 08:29:29 +00:00
const obj2 = { variant: "secondary", text: null };
const intl3 = tmp3(1236).intl;
obj2[1] = intl3.string(tmp3(1236).t.WAI6xu);
2026-08-06 08:05:19 +00:00
items[1] = tmp2(tmp3(4628).AlertActionButton, obj2, "cancel");
2026-07-29 08:29:29 +00:00
obj[0] = items;
let tmp2Result = callback2(closure_12, obj);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const obj3 = { variant: "primary", text: null };
const intl = tmp3(1236).intl;
obj3[1] = intl.string(tmp3(1236).t.BddRzS);
2026-08-06 08:05:19 +00:00
tmp2Result = tmp2(tmp3(4628).AlertActionButton, obj3, "confirm");
2026-07-20 16:05:17 +00:00
}
2026-08-06 08:05:19 +00:00
obj[3] = callback(require(4628) /* getAlertModalItemKey */.AlertActions, { children: tmp2Result });
return callback(require(4628) /* getAlertModalItemKey */.AlertModal, obj);
2026-07-20 16:05:17 +00:00
};