stream-chat-react
Version:
React components to create chat conversations or livestream style chat
20 lines (19 loc) • 1.06 kB
JavaScript
import React from 'react';
import { LoadingChannels } from '../Loading/LoadingChannels';
import { NullComponent } from '../UtilityComponents';
import { useTranslationContext } from '../../context';
/**
* A preview list of channels, allowing you to select the channel you want to open
*/
export const ChannelListMessenger = (props) => {
const { children, error = null, loading, LoadingErrorIndicator = NullComponent, LoadingIndicator = LoadingChannels, } = props;
const { t } = useTranslationContext('ChannelListMessenger');
if (error) {
return React.createElement(LoadingErrorIndicator, { error: error });
}
if (loading) {
return React.createElement(LoadingIndicator, null);
}
return (React.createElement("div", { className: 'str-chat__channel-list-messenger str-chat__channel-list-messenger-react' },
React.createElement("div", { "aria-label": t('aria/Channel list'), className: 'str-chat__channel-list-messenger__main str-chat__channel-list-messenger-react__main', role: 'listbox' }, children)));
};