// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. import * as Utils from '../utils/utils.jsx'; import {intlShape, injectIntl, defineMessages, FormattedMessage} from 'mm-intl'; const Modal = ReactBootstrap.Modal; const holders = defineMessages({ notFound: { id: 'channel_info.notFound', defaultMessage: 'No Channel Found' } }); class ChannelInfoModal extends React.Component { render() { const {formatMessage} = this.props.intl; let channel = this.props.channel; if (!channel) { channel = { display_name: formatMessage(holders.notFound), name: formatMessage(holders.notFound), purpose: formatMessage(holders.notFound), id: formatMessage(holders.notFound) }; } const channelURL = Utils.getShortenedTeamURL() + channel.name; return ( {channel.display_name}
{channel.display_name}
{channelURL}
{channel.id}
{channel.purpose}
); } } ChannelInfoModal.propTypes = { intl: intlShape.isRequired, show: React.PropTypes.bool.isRequired, onHide: React.PropTypes.func.isRequired, channel: React.PropTypes.object.isRequired }; export default injectIntl(ChannelInfoModal);