UNPKG

stream-chat-react

Version:

React components to create chat conversations or livestream style chat

13 lines (12 loc) 473 B
import { useMemo } from 'react'; export const useSplitMessageActionSet = (messageActionSet) => useMemo(() => { const quickActionSet = []; const dropdownActionSet = []; for (const action of messageActionSet) { if (action.placement === 'quick') quickActionSet.push(action); if (action.placement === 'dropdown') dropdownActionSet.push(action); } return { dropdownActionSet, quickActionSet }; }, [messageActionSet]);