The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/client/hooks/useHandleMenuAction.tsx

10 lines
348 B

import { useMutableCallback } from '@rocket.chat/fuselage-hooks';
import type { GenericMenuItemProps } from '../components/GenericMenuItem';
export const useHandleMenuAction = (items: GenericMenuItemProps[]) => {
return useMutableCallback((id) => {
const item = items.find((item) => item.id === id);
item?.onClick && item.onClick();
});
};