decord/source/modules/guild_onboarding/native/ProviderConnectionCard.tsx

135 lines
5 KiB
TypeScript
Raw Normal View History

// Module ID: 7281
// Function ID: 7282
2026-07-20 16:05:17 +00:00
// Name: ProviderConnectionCard
// Dependencies: [5, 19, 1074, 21, 4571, 5364, 1114, 7282, 7283, 1242, 4816, 1396, 4488, 1178, 4579, 7280, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 7281 (ProviderConnectionCard)
import native from "native" /* 1178 */;
import AvatarUtils from "AvatarUtils" /* 1396 */;
import shared from "shared" /* 4488 */;
import LinkIcon from "LinkIcon" /* 4579 */;
import PlatformsDefault from "Platforms" /* 5364 */;
import asyncGeneratorStep from "asyncGeneratorStep" /* 5 */;
import noop from "module_19" /* 19 */;
2026-07-23 10:11:24 +00:00
require = fn;
const AnalyticEvents = fn(1074).AnalyticEvents;
const jsx = fn(21).jsx;
const size = fn(2);
const result = size.fileFinishedImporting("modules/guild_onboarding/native/ProviderConnectionCard.tsx");
2026-07-20 16:05:17 +00:00
export default function ProviderConnectionCard(connection) {
connection = connection.connection;
const guildId = connection.guildId;
const _location = connection.location;
2026-07-23 10:11:24 +00:00
let startConnection;
2026-07-29 08:29:29 +00:00
const tmp3 = guildId(_location[4])();
asyncGeneratorStep = tmp3;
2026-07-20 16:05:17 +00:00
let stringResult = null;
if (null != connection.provider_id) {
value = tmp(tmp2[5]).get(connection.provider_id);
2026-07-20 16:05:17 +00:00
let name;
2026-07-29 08:29:29 +00:00
if (value != null) {
2026-07-20 16:05:17 +00:00
name = value.name;
}
stringResult = name;
2026-07-29 08:29:29 +00:00
const tmpResult = tmp(tmp2[5]);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (stringResult == null) {
const intl = connection(tmp2[6]).intl;
stringResult = intl.string(connection(tmp2[6]).t.NzCoRx);
2026-07-20 16:05:17 +00:00
}
if (null != connection.description) {
if (connection.description.length > 0) {
let description = connection.description;
}
2026-07-29 08:29:29 +00:00
const startProviderConnection = connection(tmp2[8]).useStartProviderConnection(connection.provider_id);
2026-07-23 10:11:24 +00:00
startConnection = startProviderConnection.startConnection;
2026-07-20 16:05:17 +00:00
({ hasConnection, canConnect, loading } = startProviderConnection);
const items = [startConnection, guildId, connection.provider_id, _location];
2026-07-29 08:29:29 +00:00
const items1 = [connection.provider_id, tmp3];
const callback = startConnection.useCallback(asyncGeneratorStep(async (arg0, value) => {
if (v3 === 2) {
v3 = 3;
throw new TypeError("Generator functions may not be called on executing generators");
2026-07-29 08:29:29 +00:00
} else if (tmp3 === 3) {
if (arg0 === 1) {
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
const obj2 = { value, done: true };
return obj2;
2026-07-29 08:29:29 +00:00
} else {
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
v3 = 2;
2026-07-29 08:29:29 +00:00
if (0 === dependencyMap) {
if (arg0 === 1) {
v3 = 3;
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
v3 = 3;
const obj3 = { value, done: true };
return obj3;
2026-07-29 08:29:29 +00:00
} else {
const obj4 = {};
const obj5 = v3(1242);
const merged = Object.assign(provider_id(4816).collectGuildAnalyticsMetadata(guildId));
obj4.connection_type = "provider";
provider_id = connection.provider_id;
2026-07-29 08:29:29 +00:00
if (provider_id == null) {
provider_id = undefined;
2026-07-29 08:29:29 +00:00
}
obj4.provider_id = provider_id;
obj4.location = _location;
obj5.track(constants.GUILD_ONBOARDING_CONNECTION_CLICKED, obj4);
2026-07-29 08:29:29 +00:00
dependencyMap = 1;
v3 = 1;
const obj6 = { value: startConnection("Guild Onboarding"), done: false };
return obj6;
2026-07-29 08:29:29 +00:00
}
} else if (arg0 === 1) {
v3 = 3;
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
v3 = 3;
const obj = { value, done: true };
2026-07-29 08:29:29 +00:00
return obj;
} else {
v3 = 3;
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} catch (tmp9) {
v3 = tmp;
2026-07-29 08:29:29 +00:00
throw tmp9;
}
2026-07-20 16:05:17 +00:00
}
}), items);
2026-07-23 10:11:24 +00:00
const memo = startConnection.useMemo(() => {
2026-07-20 16:05:17 +00:00
if (null != connection.provider_id) {
value = PlatformsDefault.get(tmp.provider_id);
let icon1;
2026-07-29 08:29:29 +00:00
if (value != null) {
icon1 = value.icon;
2026-07-20 16:05:17 +00:00
}
if (null == icon1) {
2026-07-20 16:05:17 +00:00
const source = obj2.makeSource(null);
const obj4 = { source, style: { width: 32, height: 32 }, disableColor: true };
return jsx(native.Icon, { source, style: { width: 32, height: 32 }, disableColor: true });
2026-07-20 16:05:17 +00:00
} else {
const icon = value.icon;
shared.isThemeDark(closure_3) ? icon.darkPNG : icon.lightPNG;
2026-07-20 16:05:17 +00:00
}
obj2 = AvatarUtils;
2026-07-20 16:05:17 +00:00
} else {
return jsx(LinkIcon.LinkIcon, { size: "lg", color: "text-subtle" });
2026-07-20 16:05:17 +00:00
}
}, items1);
let obj = { displayName: stringResult, description, icon: memo, isLoading: loading, isConnected: hasConnection, canConnect, onConnect: callback };
return jsx(tmp(tmp2[15]), { displayName: stringResult, description, icon: memo, isLoading: loading, isConnected: hasConnection, canConnect, onConnect: callback });
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
description = tmp(tmp2[7])(connection.provider_id);
2026-07-20 16:05:17 +00:00
};