decord/source/design/components/Menu/native/MenuItem.tsx

70 lines
2.2 KiB
TypeScript
Raw Normal View History

// Module ID: 14207
// Function ID: 14208
2026-07-20 16:05:17 +00:00
// Name: MenuItem
// Dependencies: [19, 21, 4605, 14205, 5027, 7189, 7191, 2]
2026-07-20 16:05:17 +00:00
// Module 14207 (MenuItem)
import IconDefault from "Icon" /* 5027 */;
import FormRowDefault from "FormRow" /* 7189 */;
import FormLabelDefault from "FormLabel" /* 7191 */;
import Menu from "Menu" /* 14205 */;
import noop from "module_19" /* 19 */;
2026-07-23 10:11:24 +00:00
require = fn;
const jsx = fn(21).jsx;
const createStyles = fn(4605);
let closure_5 = createStyles.createStyles({ formIcon: { width: 20, height: 20 }, formLabel: { fontSize: 14, fontWeight: "500" } });
const size = fn(2);
const result = size.fileFinishedImporting("design/components/Menu/native/MenuItem.tsx");
export const MenuItem = noop.forwardRef((action, ref) => {
2026-07-20 16:05:17 +00:00
({ label, IconComponent, iconSource, showIconFirst } = action);
if (showIconFirst === undefined) {
showIconFirst = false;
}
({ disabled, style } = action);
if (disabled === undefined) {
disabled = false;
}
2026-07-23 10:11:24 +00:00
action = action.action;
const tmp = closure_5();
const menuClose = noop.useContext(Menu.MenuContext).menuClose;
2026-07-20 16:05:17 +00:00
if (null != IconComponent) {
2026-07-29 08:29:29 +00:00
let tmp3 = <IconComponent size="sm" />;
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 != iconSource) {
const obj = { source: iconSource, style: tmp.formIcon };
tmp3 = jsx(IconDefault, { source: iconSource, style: tmp.formIcon });
2026-07-20 16:05:17 +00:00
}
}
const obj2 = { ref, style, accessibilityRole: "menuitem", disabled, leading: null, trailing: null, label: null, onPress: null };
2026-07-29 08:29:29 +00:00
let tmp10 = null;
2026-07-20 16:05:17 +00:00
if (null != iconSource) {
2026-07-29 08:29:29 +00:00
tmp10 = null;
2026-07-20 16:05:17 +00:00
if (showIconFirst) {
2026-07-29 08:29:29 +00:00
tmp10 = tmp3;
2026-07-20 16:05:17 +00:00
}
}
obj2.leading = tmp10;
2026-07-29 08:29:29 +00:00
let tmp11 = null;
2026-07-20 16:05:17 +00:00
if (null != iconSource) {
2026-07-29 08:29:29 +00:00
tmp11 = null;
2026-07-20 16:05:17 +00:00
if (!showIconFirst) {
2026-07-29 08:29:29 +00:00
tmp11 = tmp3;
2026-07-20 16:05:17 +00:00
}
}
obj2.trailing = tmp11;
2026-07-29 08:29:29 +00:00
let tmp7Result = label;
2026-08-04 21:03:28 +00:00
if (typeof label === "string") {
const obj3 = { text: label, style: tmp.formLabel };
tmp7Result = tmp7(FormLabelDefault, obj3);
2026-07-20 16:05:17 +00:00
}
obj2.label = tmp7Result;
obj2.onPress = function onPress() {
2026-07-20 16:05:17 +00:00
action();
menuClose();
};
return jsx(FormRowDefault, { ref, style, accessibilityRole: "menuitem", disabled, leading: null, trailing: null, label: null, onPress: null });
2026-07-20 16:05:17 +00:00
});