decord/source/design/components/Menu/native/MenuItem.tsx
github-actions 777dc50a28 chore: update source for alpha 346.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4790.js (118.4 MB)
2026-09-10 19:12:31 +00:00

69 lines
2.2 KiB
TypeScript

// Module ID: 14207
// Function ID: 14208
// Name: MenuItem
// Dependencies: [19, 21, 4605, 14205, 5027, 7189, 7191, 2]
// 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 */;
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) => {
({ label, IconComponent, iconSource, showIconFirst } = action);
if (showIconFirst === undefined) {
showIconFirst = false;
}
({ disabled, style } = action);
if (disabled === undefined) {
disabled = false;
}
action = action.action;
const tmp = closure_5();
const menuClose = noop.useContext(Menu.MenuContext).menuClose;
if (null != IconComponent) {
let tmp3 = <IconComponent size="sm" />;
} else {
tmp3 = null;
if (null != iconSource) {
const obj = { source: iconSource, style: tmp.formIcon };
tmp3 = jsx(IconDefault, { source: iconSource, style: tmp.formIcon });
}
}
const obj2 = { ref, style, accessibilityRole: "menuitem", disabled, leading: null, trailing: null, label: null, onPress: null };
let tmp10 = null;
if (null != iconSource) {
tmp10 = null;
if (showIconFirst) {
tmp10 = tmp3;
}
}
obj2.leading = tmp10;
let tmp11 = null;
if (null != iconSource) {
tmp11 = null;
if (!showIconFirst) {
tmp11 = tmp3;
}
}
obj2.trailing = tmp11;
let tmp7Result = label;
if (typeof label === "string") {
const obj3 = { text: label, style: tmp.formLabel };
tmp7Result = tmp7(FormLabelDefault, obj3);
}
obj2.label = tmp7Result;
obj2.onPress = function onPress() {
action();
menuClose();
};
return jsx(FormRowDefault, { ref, style, accessibilityRole: "menuitem", disabled, leading: null, trailing: null, label: null, onPress: null });
});