import React, { PureComponent } from 'react'; import Navicon from 'containers/Navicon'; import Editable from 'components/ui/Editable'; import { isValidServerName } from 'state/servers'; import { isChannel, linkify } from 'utils'; export default class ChatTitle extends PureComponent { render() { const { status, title, tab, channel, onTitleChange, onToggleSearch, onToggleUserList, onCloseClick } = this.props; 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}
); } }