import React, { memo } from 'react'; import Navicon from 'containers/Navicon'; import Editable from 'components/ui/Editable'; import { isValidServerName } from 'state/servers'; import { isChannel, linkify } from 'utils'; const ChatTitle = ({ status, title, tab, channel, onTitleChange, onToggleSearch, onToggleUserList, onCloseClick }) => { let closeTitle; if (isChannel(tab)) { closeTitle = 'Leave'; } else if (tab.name) { closeTitle = 'Close'; } else { closeTitle = 'Disconnect'; } let serverError = null; if (!tab.name && status.error) { serverError = ( Error: {status.error} ); } return (
{title}
{channel && linkify(channel.topic)} {serverError}
{channel && channel.users.length}
); }; export default memo(ChatTitle);