import { h } from 'preact'; import PropTypes from 'prop-types'; // eslint-disable-next-line import/no-unresolved import ConfigImage from 'images/three-dots.svg'; const Channels = ({ activeChannelId, chatChannels, unopenedChannelIds, handleSwitchChannel, expanded, filterQuery, channelsLoaded, }) => { const channels = chatChannels.map(channel => { const isActive = parseInt(activeChannelId, 10) === channel.chat_channel_id; const isUnopened = !isActive && unopenedChannelIds.includes(channel.chat_channel_id); let newMessagesIndicator = isUnopened ? 'new' : 'old'; const otherClassname = isActive ? 'chatchanneltab--active' : 'chatchanneltab--inactive'; return ( ); }); let topNotice = ''; if ( expanded && filterQuery.length === 0 && channelsLoaded && (channels.length === 0 || channels[0].messages_count === 0) ) { topNotice = (