MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / getPgMenuItem

Function getPgMenuItem

web/pgadmin/static/js/AppMenuBar.jsx:75–95  ·  view source on GitHub ↗
(menuItem, i)

Source from the content-addressed store, hash-verified

73 }, []);
74
75 const getPgMenuItem = (menuItem, i)=>{
76 if(menuItem.type == 'separator') {
77 return <PgMenuDivider key={i}/>;
78 }
79 const hasCheck = typeof menuItem.checked == 'boolean';
80
81 return <PgMenuItem
82 key={i}
83 disabled={menuItem.isDisabled}
84 onClick={()=>{
85 menuItem.callback();
86 if(hasCheck) {
87 forceUpdate();
88 }
89 }}
90 hasCheck={hasCheck}
91 checked={menuItem.checked}
92 closeOnCheck={true}
93 shortcut={menuItem.shortcut}
94 >{menuItem.label}</PgMenuItem>;
95 };
96
97 const userMenuInfo = pgAdmin.Browser.utils.userMenuInfo;
98

Callers 2

getPgMenuFunction · 0.70
AppMenuBarFunction · 0.70

Calls 1

callbackMethod · 0.45

Tested by

no test coverage detected