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

112 lines
4.8 KiB
TypeScript
Raw Normal View History

// Module ID: 16872
// Function ID: 16873
2026-07-20 16:05:17 +00:00
// Name: ContextMenuCommandItem
// Dependencies: [19, 17, 21, 4560, 576, 5605, 12, 1114, 12235, 5587, 1894, 4505, 2]
2026-07-20 16:05:17 +00:00
// Exports: ContextMenuCommandAppItem, ContextMenuCommandEmptyItem, ContextMenuCommandLoadingItem, default
// Module 16872 (ContextMenuCommandItem)
2026-08-24 06:08:38 +00:00
import applyDefault from "apply" /* 12 */;
import ThemesDefault from "Themes" /* 576 */;
import getSystemLocale from "getSystemLocale" /* 1114 */;
import preloadDefault from "preload" /* 5587 */;
import TableRowInner from "TableRowInner" /* 5605 */;
import getApplicationCommandsIconSource from "getApplicationCommandsIconSource" /* 12235 */;
2026-08-24 06:08:38 +00:00
import closure_3 from "noop" /* 19 */;
import { View } from "get ActivityIndicator" /* 17 */;
import { jsx } from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4560 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-29 08:29:29 +00:00
createCacheKey = { commandIcon: null, loadingIcon: null, loadingName: null };
2026-08-24 06:08:38 +00:00
createCacheKey = { width: 32, height: 32, borderRadius: ThemesDefault.radii.lg };
2026-07-29 08:29:29 +00:00
createCacheKey[0] = createCacheKey;
2026-08-24 06:08:38 +00:00
createCacheKey[1] = { backgroundColor: ThemesDefault.colors.BACKGROUND_MOD_MUTED };
const obj1 = { backgroundColor: ThemesDefault.colors.BACKGROUND_MOD_MUTED };
createCacheKey[2] = { backgroundColor: ThemesDefault.colors.BACKGROUND_MOD_MUTED, height: 24, borderRadius: ThemesDefault.radii.md };
let closure_6 = createCacheKey.createStyles(createCacheKey);
const obj2 = { backgroundColor: ThemesDefault.colors.BACKGROUND_MOD_MUTED, height: 24, borderRadius: ThemesDefault.radii.md };
const result = require("set").fileFinishedImporting("modules/application_commands/native/ContextMenuCommandItem.tsx");
2026-07-20 16:05:17 +00:00
export default function ContextMenuCommandItem(item) {
item = item.item;
const section = item.section;
({ onPress, start, end } = item);
const items = [item, ];
let name;
2026-07-29 08:29:29 +00:00
if (section != null) {
2026-07-20 16:05:17 +00:00
name = section.name;
}
items[1] = name;
const memo = React.useMemo(() => {
const type = item.type;
2026-07-29 08:29:29 +00:00
const intl = tmp2(tmp3[7]).intl;
2026-07-20 16:05:17 +00:00
let name;
2026-07-29 08:29:29 +00:00
if (section != null) {
2026-07-20 16:05:17 +00:00
name = section.name;
}
2026-08-24 06:08:38 +00:00
return intl.formatToPlainString(item(closure_1_2[7]).t.Pk4Mz3, { applicationName: name, commandName: item.displayName });
2026-07-20 16:05:17 +00:00
}, items);
let obj = item(12235);
2026-07-20 16:05:17 +00:00
const applicationCommandsIconSource = obj.getApplicationCommandsIconSource(section);
2026-07-29 08:29:29 +00:00
obj = { accessibilityLabel: memo, onPress, label: item.displayName, icon: null, trailing: null, start: null, end: null };
let tmp8Result = null != applicationCommandsIconSource;
if (tmp8Result) {
obj = { style: null, source: null };
obj[0] = tmp.commandIcon;
obj[1] = applicationCommandsIconSource;
tmp8Result = tmp8(section(5587), obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[3] = tmp8Result;
obj[4] = jsx(item(4505).SendMessageIcon, {});
2026-07-29 08:29:29 +00:00
obj[5] = start;
obj[6] = end;
return jsx(item(5605).TableRow, { accessibilityLabel: memo, onPress, label: item.displayName, icon: null, trailing: null, start: null, end: null });
2026-07-20 16:05:17 +00:00
};
export const ContextMenuCommandLoadingItem = function ContextMenuCommandLoadingItem(arg0) {
({ start, end } = arg0);
2026-08-24 06:08:38 +00:00
const tmp = callback();
2026-07-29 08:29:29 +00:00
let obj = { label: null, icon: null, start: null, end: null };
obj = { style: null };
2026-07-20 16:05:17 +00:00
const items = [tmp.loadingName, ];
2026-08-24 06:08:38 +00:00
obj = { width: "" + applyDefault.random(60, 80) + "%" };
2026-07-20 16:05:17 +00:00
items[1] = obj;
2026-07-29 08:29:29 +00:00
obj[0] = items;
2026-08-24 06:08:38 +00:00
obj[0] = <View width={"" + applyDefault.random(60, 80) + "%"} />;
2026-07-20 16:05:17 +00:00
const items1 = [, ];
({ commandIcon: arr2[0], loadingIcon: arr2[1] } = tmp);
2026-07-29 08:29:29 +00:00
obj[1] = <View style={items1} />;
obj[2] = start;
obj[3] = end;
2026-08-24 06:08:38 +00:00
return jsx(TableRowInner.TableRow, { width: "" + applyDefault.random(60, 80) + "%" });
2026-07-20 16:05:17 +00:00
};
export const ContextMenuCommandEmptyItem = function ContextMenuCommandEmptyItem(arg0) {
({ start, end } = arg0);
2026-07-29 08:29:29 +00:00
const obj = { label: null, icon: null, start: null, end: null };
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale.intl;
obj[0] = intl.string(getSystemLocale.t.YSNlV2);
2026-07-20 16:05:17 +00:00
const items = [, ];
2026-08-24 06:08:38 +00:00
({ commandIcon: arr[0], loadingIcon: arr[1] } = callback());
2026-07-29 08:29:29 +00:00
obj[1] = <View style={items} />;
obj[2] = start;
obj[3] = end;
2026-08-24 06:08:38 +00:00
return jsx(TableRowInner.TableRow, { label: null, icon: null, start: null, end: null });
2026-07-20 16:05:17 +00:00
};
export const ContextMenuCommandAppItem = function ContextMenuCommandAppItem(section) {
section = section.section;
({ onPress, start, end } = section);
2026-08-24 06:08:38 +00:00
let obj = getApplicationCommandsIconSource;
2026-07-20 16:05:17 +00:00
const applicationCommandsIconSource = obj.getApplicationCommandsIconSource(section);
2026-07-29 08:29:29 +00:00
obj = { onPress, label: section.name, icon: null, start: null, end: null, arrow: true };
let tmp4Result = null != applicationCommandsIconSource;
if (tmp4Result) {
obj = { style: null, source: null };
obj[0] = tmp.commandIcon;
obj[1] = applicationCommandsIconSource;
2026-08-24 06:08:38 +00:00
tmp4Result = tmp4(preloadDefault, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[2] = tmp4Result;
obj[3] = start;
obj[4] = end;
2026-08-24 06:08:38 +00:00
return jsx(TableRowInner.TableRow, { onPress, label: section.name, icon: null, start: null, end: null, arrow: true });
2026-07-20 16:05:17 +00:00
};