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

Function refactorMenuItems

web/pgadmin/static/js/QuickSearch/index.jsx:188–206  ·  view source on GitHub ↗
(items)

Source from the content-addressed store, hash-verified

186 };
187
188 const refactorMenuItems = (items) => {
189 if(items.length > 0){
190 let menuItemsHtmlElement = [];
191 items.forEach((i) => {
192 menuItemsHtmlElement.push(
193 <div key={ 'li-menu-' + i.label }><a tabIndex={i.isDisabled ? '-1' : '0'} id={ 'li-menu-' + i.label } href={'#'} className={ (i.isDisabled ? 'QuickSearch-searchItem disabled':'QuickSearch-searchItem')} onClick={
194 () => {
195 closeModal();
196 i.callback();
197 }
198 }>
199 {i.label}
200 <span key={ 'menu-span-' + i.label }>{i.path}</span>
201 </a>
202 </div>);
203 });
204 return menuItemsHtmlElement;
205 }
206 };
207
208
209 const onInputValueChange = (value) => {

Callers 1

QuickSearchFunction · 0.85

Calls 2

closeModalFunction · 0.85
callbackMethod · 0.45

Tested by

no test coverage detected