decord/source/design/components/Menu/native/MenuItem.tsx
2026-09-02 09:53:35 +00:00

71 lines
2.2 KiB
TypeScript

// Module ID: 13998
// Function ID: 13999
// Name: MenuItem
// Dependencies: [19, 21, 4478, 13996, 4930, 5600, 5619, 2]
// Module 13998 (MenuItem)
import importAllResult from "noop" /* 19 */;
import { jsx } from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4478 */;
const require = arg1;
let c3 = importAllResult;
let closure_5 = createCacheKey.createStyles({ formIcon: { width: 20, height: 20 }, formLabel: { fontSize: 14, fontWeight: "500" } });
const forwardRefResult = importAllResult.forwardRef((action, ref) => {
({ label, IconComponent, iconSource, showIconFirst } = action);
if (showIconFirst === undefined) {
showIconFirst = false;
}
({ disabled, style } = action);
if (disabled === undefined) {
disabled = false;
}
action = action.action;
let menuClose;
const tmp = callback();
menuClose = importAllResult.useContext(action(13996).MenuContext).menuClose;
if (null != IconComponent) {
let tmp3 = <IconComponent size="sm" />;
} else {
tmp3 = null;
if (null != iconSource) {
let obj = { source: null, style: null };
obj[0] = iconSource;
obj[1] = tmp.formIcon;
tmp3 = jsx(menuClose(4930), { source: null, style: null });
}
}
obj = { 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;
}
}
obj[4] = tmp10;
let tmp11 = null;
if (null != iconSource) {
tmp11 = null;
if (!showIconFirst) {
tmp11 = tmp3;
}
}
obj[5] = tmp11;
let tmp7Result = label;
if (typeof label === "string") {
obj = { text: null, style: null };
obj[0] = label;
obj[1] = tmp.formLabel;
tmp7Result = tmp7(menuClose(5619), obj);
}
obj[6] = tmp7Result;
obj[7] = function onPress() {
action();
menuClose();
};
return jsx(menuClose(5600), { ref, style, accessibilityRole: "menuitem", disabled, leading: null, trailing: null, label: null, onPress: null });
});
const result = require("set").fileFinishedImporting("design/components/Menu/native/MenuItem.tsx");
export const MenuItem = forwardRefResult;