import React, { PureComponent } from 'react'; import { List } from 'immutable'; import Navicon from 'containers/Navicon'; import Editable from 'components/ui/Editable'; import { isValidServerName } from 'state/servers'; import { linkify } from 'util'; export default class ChatTitle extends PureComponent { render() { const { status, title, tab, channel, onTitleChange, onToggleSearch, onToggleUserList, onCloseClick } = this.props; let closeTitle; if (tab.isChannel()) { 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}
{linkify(channel.get('topic')) || null} {serverError}
{channel.get('users', List()).size}
); } }