import React, { Component } from 'react'; import { List } from 'immutable'; import Autolinker from 'autolinker'; import pure from 'pure-render-decorator'; import Navicon from '../components/Navicon'; @pure export default class ChatTitle extends Component { handleLeaveClick = () => { const { tab, channel, disconnect, part, closePrivateChat } = this.props; if (tab.channel) { part([channel.get('name')], tab.server); } else if (tab.user) { closePrivateChat(tab.server, tab.user); } else { disconnect(tab.server); } } render() { const { title, tab, channel, toggleSearch } = this.props; const topic = Autolinker.link(channel.get('topic') || '', { keepOriginalText: true }); let leaveTitle; if (tab.channel) { leaveTitle = 'Leave'; } else if (tab.user) { leaveTitle = 'Close'; } else { leaveTitle = 'Disconnect'; } return (