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/client/views/room/lib/QuickActions/QuickActionsContext.tsx

20 lines
660 B

import { EventHandlerOf } from '@rocket.chat/emitter';
import { createContext, useContext } from 'react';
import { actions, listen, QuickActionsActionConfig, QuickActionsAction, Events } from '.';
import './defaultActions';
export type QuickActionsEventHandler = (handler: EventHandlerOf<Events, 'change'>) => Function;
export type QuickActionsContext = {
actions: Map<QuickActionsActionConfig['id'], QuickActionsAction>;
listen: QuickActionsEventHandler;
};
export const QuickActionsContext = createContext<QuickActionsContext>({
actions,
listen,
});
export const useQuickActionsContext = (): QuickActionsContext => useContext(QuickActionsContext);