// 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 'react-intl'; import {Modal} from 'react-bootstrap'; const holders = defineMessages({ notFound: { id: 'channel_info.notFound', defaultMessage: 'No Channel Found' } }); import React from 'react'; 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);