2019-05-07 04:35:04 +02:00
|
|
|
// @flow
|
|
|
|
import React, { Fragment } from 'react';
|
2019-05-29 23:54:47 +02:00
|
|
|
import MarkdownPreview from 'component/common/markdown-preview';
|
2019-05-07 04:35:04 +02:00
|
|
|
|
|
|
|
type Props = {
|
|
|
|
description: ?string,
|
|
|
|
email: ?string,
|
|
|
|
website: ?string,
|
|
|
|
};
|
|
|
|
|
|
|
|
function ChannelContent(props: Props) {
|
|
|
|
const { description, email, website } = props;
|
|
|
|
const showAbout = description || email || website;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<section>
|
|
|
|
{!showAbout && <h2 className="empty">{__('Nothing here yet')}</h2>}
|
|
|
|
{showAbout && (
|
|
|
|
<Fragment>
|
2019-05-29 23:54:47 +02:00
|
|
|
{description && (
|
|
|
|
<div className="media__info-text">
|
|
|
|
<MarkdownPreview content={description} promptLinks />
|
|
|
|
</div>
|
|
|
|
)}
|
2019-05-07 04:35:04 +02:00
|
|
|
{email && (
|
|
|
|
<Fragment>
|
|
|
|
<div className="media__info-title">{__('Contact')}</div>
|
|
|
|
<div className="media__info-text">{email}</div>
|
|
|
|
</Fragment>
|
|
|
|
)}
|
|
|
|
{website && (
|
|
|
|
<Fragment>
|
|
|
|
<div className="media__info-title">{__('Site')}</div>
|
2019-05-29 23:54:47 +02:00
|
|
|
<div className="media__info-text">
|
|
|
|
<MarkdownPreview content={website} promptLinks />
|
|
|
|
</div>
|
2019-05-07 04:35:04 +02:00
|
|
|
</Fragment>
|
|
|
|
)}
|
|
|
|
</Fragment>
|
|
|
|
)}
|
|
|
|
</section>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ChannelContent;
|