;
/**
* Typescript currently does not support partial inference so if ChatContext
* typing is desired while using the HOC withChatContext the Props for the
* wrapped component must be provided as the first generic.
*/
export const withChatContext = <
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 WithChatContextComponent = (
props: Omit>,
) => {
const chatContext = useChatContext();
return ;
};
WithChatContextComponent.displayName = `WithChatContext${getDisplayName(Component)}`;
return WithChatContextComponent;
};