decord/source/modules/application_commands/native/ApplicationCommandItem.tsx

105 lines
4.3 KiB
TypeScript
Raw Normal View History

2026-07-28 08:39:19 +00:00
// Module ID: 11474
// Function ID: 89037
2026-07-20 16:05:17 +00:00
// Name: ApplicationCommandItem
2026-07-28 08:39:19 +00:00
// Dependencies: [31, 27, 1918, 9555, 33, 4165, 689, 4584, 566, 11367, 4695, 1212, 5119, 4161, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-28 08:39:19 +00:00
// Module 11474 (ApplicationCommandItem)
2026-07-23 10:11:24 +00:00
import result from "result";
import { View } from "get ActivityIndicator";
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import { AUTOCOMPLETE_ROW_HEIGHT } from "AUTOCOMPLETE_ROW_HEIGHT";
import jsxProd from "jsxProd";
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose";
let closure_7;
let closure_8;
const require = arg1;
({ jsx: closure_7, jsxs: closure_8 } = jsxProd);
let closure_9 = _createForOfIteratorHelperLoose.createStyles((arg0) => {
2026-07-20 16:05:17 +00:00
let obj = {};
2026-07-23 10:11:24 +00:00
obj = { flexDirection: "row", paddingVertical: 8, paddingHorizontal: 16, alignItems: "center", height: Math.max(arg0 * AUTOCOMPLETE_ROW_HEIGHT, AUTOCOMPLETE_ROW_HEIGHT) };
2026-07-20 16:05:17 +00:00
obj.applicationCommandItem = obj;
2026-07-23 10:11:24 +00:00
obj = { backgroundColor: importDefault(689).colors.INTERACTIVE_BACKGROUND_HOVER };
2026-07-20 16:05:17 +00:00
obj.highlightedApplicationCommandItem = obj;
2026-07-23 10:11:24 +00:00
const obj1 = { width: 32, height: 32, borderRadius: importDefault(689).radii.lg, marginRight: 16 };
obj.applicationCommandIcon = obj1;
obj.applicationCommandDescriptionWrapper = { flexDirection: "column", flexShrink: 1, alignSelf: "flex-end" };
obj.applicationCommandSectionName = { paddingLeft: 16, marginLeft: "auto" };
2026-07-20 16:05:17 +00:00
return obj;
});
2026-07-23 10:11:24 +00:00
const result = require("_isNativeReflectConstruct").fileFinishedImporting("modules/application_commands/native/ApplicationCommandItem.tsx");
2026-07-20 16:05:17 +00:00
export default function ApplicationCommandItem(highlighted) {
let command;
2026-07-23 10:11:24 +00:00
let importDefault;
2026-07-20 16:05:17 +00:00
let section;
let showIcon;
({ command, section } = highlighted);
2026-07-23 10:11:24 +00:00
({ guildId: importDefault, showIcon } = highlighted);
2026-07-20 16:05:17 +00:00
if (showIcon === undefined) {
showIcon = true;
}
let flag = highlighted.highlighted;
if (flag === undefined) {
flag = false;
}
2026-07-23 10:11:24 +00:00
let stateFromStores;
let obj = section(stateFromStores[7]);
2026-07-20 16:05:17 +00:00
const tmp = callback3(obj.useFontScale());
2026-07-23 10:11:24 +00:00
let obj1 = section(stateFromStores[8]);
const items = [_isNativeReflectConstruct];
stateFromStores = obj1.useStateFromStores(items, () => {
2026-07-20 16:05:17 +00:00
if (null != closure_1) {
let botId;
if (null != section) {
botId = section.botId;
}
if (null != botId) {
2026-07-23 10:11:24 +00:00
return outer1_5.getMember(closure_1, section.botId);
2026-07-20 16:05:17 +00:00
}
}
});
const items1 = [section, stateFromStores];
const memo = React.useMemo(() => section(stateFromStores[9]).getApplicationCommandsIconSource(section, stateFromStores), items1);
let nick;
if (null != stateFromStores) {
nick = stateFromStores.nick;
}
if (null != nick) {
let name = stateFromStores.nick;
} else if (null != section) {
name = section.name;
}
obj = {};
2026-07-23 10:11:24 +00:00
const intl = section(stateFromStores[11]).intl;
2026-07-20 16:05:17 +00:00
obj = { applicationName: name };
({ displayDescription: obj4.commandDescription, displayName: obj4.commandName } = command);
2026-07-23 10:11:24 +00:00
obj.accessibilityLabel = intl.formatToPlainString(section(stateFromStores[11]).t.eo8b3e, obj);
2026-07-20 16:05:17 +00:00
obj1 = {};
const merged = Object.assign(tmp.applicationCommandItem);
const merged1 = Object.assign(flag ? tmp.highlightedApplicationCommandItem : {});
obj.style = obj1;
obj.accessibilityRole = "button";
obj.onPress = highlighted.onPress;
if (showIcon) {
showIcon = null != memo;
}
if (showIcon) {
const obj2 = { style: tmp.applicationCommandIcon, source: memo };
2026-07-23 10:11:24 +00:00
showIcon = callback(importDefault(stateFromStores[12]), obj2);
2026-07-20 16:05:17 +00:00
}
const items2 = [showIcon, , ];
const obj3 = { style: tmp.applicationCommandDescriptionWrapper };
2026-07-23 10:11:24 +00:00
const obj4 = { lineClamp: 1, variant: "text-md/semibold", color: "mobile-text-heading-primary", children: `/ ${command.displayName}` };
const items3 = [callback(section(stateFromStores[13]).Text, obj4), ];
const obj5 = { lineClamp: 1, variant: "text-xs/medium", color: "text-default", children: command.displayDescription };
items3[1] = callback(section(stateFromStores[13]).Text, obj5);
2026-07-20 16:05:17 +00:00
obj3.children = items3;
items2[1] = callback2(View, obj3);
2026-07-23 10:11:24 +00:00
const obj6 = { style: tmp.applicationCommandSectionName, variant: "eyebrow", color: "text-muted", children: name };
items2[2] = callback(section(stateFromStores[13]).Text, obj6);
2026-07-20 16:05:17 +00:00
obj.children = items2;
2026-07-23 10:11:24 +00:00
return callback2(section(stateFromStores[10]).PressableOpacity, obj);
2026-07-20 16:05:17 +00:00
};