// @flow 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 DateTime from 'component/dateTime'; import YoutubeBadge from 'component/youtubeBadge'; import SUPPORTED_LANGUAGES from 'constants/supported_languages'; import { formatNumber } from 'util/number'; 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}
{formatNumber(claim.meta.claims_in_channel || 0, 2, true)}
{claim.canonical_url}
{claim.claim_id}
{' '}
); } export default ChannelAbout;