;
/**
* Typescript currently does not support partial inference so if ChatContext
* typing is desired while using the HOC withChannelContext the Props for the
* wrapped component must be provided as the first generic.
*/
export const withChannelsContext = <
P extends UnknownType,
At extends UnknownType = DefaultAttachmentType,
Ch extends UnknownType = DefaultChannelType,
Co extends string = DefaultCommandType,
Ev extends UnknownType = DefaultEventType,
Me extends UnknownType = DefaultMessageType,
Re extends UnknownType = DefaultReactionType,
Us extends UnknownType = DefaultUserType,
>(
Component: React.ComponentType,
): React.FC>> => {
const WithChannelsContextComponent = (
props: Omit>,
) => {
const channelsContext = useChannelsContext();
return ;
};
WithChannelsContextComponent.displayName = `WithChannelsContext${getDisplayName(Component)}`;
return WithChannelsContextComponent;
};