// @flow import { SIMPLE_SITE } from 'config'; import React, { Fragment } from 'react'; import MarkdownPreview from 'component/common/markdown-preview'; import ClaimTags from 'component/claimTags'; import CreditAmount from 'component/common/credit-amount'; import Button from 'component/button'; import * as PAGES from 'constants/pages'; import DateTime from 'component/dateTime'; import YoutubeBadge from 'component/youtubeBadge'; import SUPPORTED_LANGUAGES from 'constants/supported_languages'; type Props = { claim: ChannelClaim, uri: string, description: ?string, email: ?string, website: ?string, languages: Array, }; const formatEmail = (email: string) => { if (email) { const protocolRegex = new RegExp('^mailto:', 'i'); const protocol = protocolRegex.exec(email); return protocol ? email : `mailto:${email}`; } return null; }; function ChannelAbout(props: Props) { const { claim, uri, description, email, website, languages } = props; const claimId = claim && claim.claim_id; return (
{description && ( <>
)} {email && (
)} {website && (
)}
{/* this could use some nice 'tags' styling */} {languages && languages.length ? languages.reduce((acc, lang, i) => { return acc + `${__(SUPPORTED_LANGUAGES[lang])}` + ' '; }, '') : null}
{claim.meta.claims_in_channel}
{claim.canonical_url}
{claim.claim_id}
{' '} {SIMPLE_SITE && (
); } export default ChannelAbout;