decord/source/modules/guild_settings/native/MembersPruneActionSheet.tsx

137 lines
4.8 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 15899
// Function ID: 15900
2026-07-20 16:05:17 +00:00
// Name: MembersPruneActionSheetContent
2026-08-24 06:08:38 +00:00
// Dependencies: [32, 19, 15900, 1910, 4024, 1922, 21, 709, 15901, 7213, 6987, 1236, 8140, 8139, 4739, 4750, 4346, 589, 7269, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 15899 (MembersPruneActionSheetContent)
import closure_3 from "_slicedToArray" /* 32 */;
import closure_4 from "noop" /* 19 */;
import CACHE_TTL_MS from "CACHE_TTL_MS" /* 15900 */;
import closure_8 from "createGuildRecordFromRust" /* 1910 */;
import closure_9 from "getUncachedChannelPermissions" /* 4024 */;
import closure_10 from "mergeGuildAvatar" /* 1922 */;
import jsxProd from "jsxProd" /* 21 */;
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function MembersPruneActionSheetContent(guild) {
guild = guild.guild;
2026-07-29 08:29:29 +00:00
let id;
let first;
let callback;
let num;
id = guild.id;
let tmp = callback(num.useState(7), 2);
first = tmp[0];
2026-07-23 10:11:24 +00:00
callback = tmp[1];
2026-07-20 16:05:17 +00:00
const tmp3 = callback2(guild.id, first, []);
2026-07-29 08:29:29 +00:00
num = tmp3.count;
2026-07-20 16:05:17 +00:00
const items = [guild.id, first];
2026-07-29 08:29:29 +00:00
const effect = num.useEffect(() => {
2026-07-20 16:05:17 +00:00
function handlePruneUpdate(guildId) {
if (guildId.guildId === handlePruneUpdate.id) {
if (guildId.prune.isPreview) {
const _Number = Number;
2026-08-24 06:08:38 +00:00
closure_1_6(guildId.guildId, guildId.prune.days, guildId.prune.includeRoles, Number(guildId.prune.pruneCount), guildId.prune.isFinished);
2026-07-20 16:05:17 +00:00
}
}
}
const subscription = id(first[7]).subscribe("GUILD_PRUNE_UPDATE", handlePruneUpdate);
return () => {
2026-07-23 10:11:24 +00:00
id(first[7]).unsubscribe("GUILD_PRUNE_UPDATE", handlePruneUpdate);
2026-07-20 16:05:17 +00:00
};
}, items);
2026-07-29 08:29:29 +00:00
const items1 = [guild.id, first, num];
const effect1 = num.useEffect(() => {
if (null == num) {
2026-07-20 16:05:17 +00:00
id(first[8]).updateEstimateV2(guild.id, first);
const obj = id(first[8]);
}
}, items1);
2026-07-29 08:29:29 +00:00
let obj = { header: null, children: null };
obj = { title: null };
2026-07-23 10:11:24 +00:00
const intl = guild(first[11]).intl;
2026-07-29 08:29:29 +00:00
obj[0] = intl.string(guild(first[11]).t.zbyz7p);
obj[0] = callback3(guild(first[10]).BottomSheetTitleHeader, obj);
obj = { title: null, defaultValue: null, onChange: null, hasIcons: false, children: null };
2026-07-23 10:11:24 +00:00
const intl2 = guild(first[11]).intl;
2026-07-29 08:29:29 +00:00
obj[0] = intl2.string(guild(first[11]).t.YccTvK);
obj[1] = first;
obj[2] = function onChange(arg0) {
2026-07-20 16:05:17 +00:00
let tmp = first !== arg0;
if (tmp) {
tmp = null != id;
}
if (tmp) {
callback(arg0);
}
};
2026-08-24 06:08:38 +00:00
obj1 = { value: 7, label: null };
2026-07-23 10:11:24 +00:00
const intl3 = guild(first[11]).intl;
2026-07-29 08:29:29 +00:00
obj1[1] = intl3.formatToPlainString(guild(first[11]).t.FM1dHS, { days: 7 });
2026-07-23 10:11:24 +00:00
const items2 = [callback3(guild(first[13]).TableRadioRow, obj1), ];
2026-07-29 08:29:29 +00:00
let obj2 = { value: 30, label: null };
2026-07-23 10:11:24 +00:00
const intl4 = guild(first[11]).intl;
2026-07-29 08:29:29 +00:00
obj2[1] = intl4.formatToPlainString(guild(first[11]).t.FM1dHS, { days: 30 });
2026-07-23 10:11:24 +00:00
items2[1] = callback3(guild(first[13]).TableRadioRow, obj2);
2026-07-29 08:29:29 +00:00
obj[4] = items2;
2026-07-23 10:11:24 +00:00
const items3 = [callback4(guild(first[12]).TableRadioGroup, obj), , ];
const intl5 = guild(first[11]).intl;
const t = guild(first[11]).t;
2026-07-29 08:29:29 +00:00
if (num == null) {
num = -1;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items3[1] = callback3(guild(first[14]).Text, { variant: "text-sm/medium", children: intl5.format(tmp3.isLoading ? t["98cHOp"] : t.f13az9, { members: num, days: first }) });
const obj4 = {
2026-07-20 16:05:17 +00:00
variant: "destructive",
onPress() {
2026-07-29 08:29:29 +00:00
let tmp2 = null != id;
if (tmp2) {
tmp2 = null != first;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp2) {
2026-07-20 16:05:17 +00:00
id(first[8]).prune(id, first);
const obj = id(first[8]);
id(first[16]).hideActionSheet();
2026-08-24 06:08:38 +00:00
closure_1_7();
2026-07-20 16:05:17 +00:00
const obj2 = id(first[16]);
}
2026-07-29 08:29:29 +00:00
},
text: null
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
const intl6 = tmp7(tmp8[11]).intl;
obj4[2] = intl6.string(guild(first[11]).t["2mIlKQ"]);
items3[2] = callback3(guild(first[15]).Button, obj4);
obj[1] = items3;
2026-07-23 10:11:24 +00:00
return callback4(guild(first[9]).ActionSheet, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
({ usePrunePreview: c5, setPrunePreview: closure_6, clearAllPrunePreviews: error } = CACHE_TTL_MS);
({ jsx: unpackModuleId, jsxs: closure_12 } = jsxProd);
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/guild_settings/native/MembersPruneActionSheet.tsx");
2026-07-20 16:05:17 +00:00
export default function MembersPruneActionSheet(guild) {
guild = guild.guild;
2026-07-29 08:29:29 +00:00
let stateFromStores;
let obj = guild(589);
2026-08-24 06:08:38 +00:00
const items = [closure_8, closure_9, closure_10];
2026-07-20 16:05:17 +00:00
const items1 = [guild];
2026-07-29 08:29:29 +00:00
stateFromStores = obj.useStateFromStores(items, () => {
2026-08-24 06:08:38 +00:00
guild = closure_1_8.getGuild(guild.id);
return guild(closure_1_2[18]).canPruneGuildMembers(guild, closure_1_10.getCurrentUser(), closure_1_9);
2026-07-20 16:05:17 +00:00
}, items1);
const items2 = [stateFromStores];
const effect = React.useEffect(() => {
if (!stateFromStores) {
2026-08-24 06:08:38 +00:00
stateFromStores(closure_1_2[16]).hideActionSheet();
const obj = stateFromStores(closure_1_2[16]);
2026-07-20 16:05:17 +00:00
}
}, items2);
let tmp3 = null;
if (stateFromStores) {
2026-07-29 08:29:29 +00:00
obj = { guild: null };
obj[0] = guild;
2026-07-20 16:05:17 +00:00
tmp3 = callback3(MembersPruneActionSheetContent, obj);
}
return tmp3;
};