// @flow import * as React from 'react'; import { normalizeURI } from 'util/lbryURI'; import FilePrice from 'component/filePrice'; import ClaimInsufficientCredits from 'component/claimInsufficientCredits'; import FileSubtitle from 'component/fileSubtitle'; import ClaimAuthor from 'component/claimAuthor'; import Card from 'component/common/card'; import * as ICONS from 'constants/icons'; import * as PAGES from 'constants/pages'; import Icon from 'component/common/icon'; import I18nMessage from 'component/i18nMessage'; import Button from 'component/button'; import FileDescription from 'component/fileDescription'; import usePersistedState from 'effects/use-persisted-state'; import { ENABLE_MATURE } from 'config'; type Props = { uri: string, title: string, nsfw: boolean, isNsfwBlocked: boolean, livestream?: boolean, isLive?: boolean, viewers?: number, subCount: number, channelClaimId?: string, fetchSubCount: (string) => void, }; function FileTitleSection(props: Props) { const { title, uri, nsfw, isNsfwBlocked, livestream = false, isLive = false, viewers, subCount, channelClaimId, fetchSubCount, } = props; const [hasAcknowledgedSec, setHasAcknowledgedSec] = usePersistedState('sec-nag', false); React.useEffect(() => { if (channelClaimId) { fetchSubCount(channelClaimId); } }, [channelClaimId, fetchSubCount]); return ( <> {!hasAcknowledgedSec && (
)} {title} {nsfw && ( {__('Mature')} )} } titleActions={} body={ } actions={ isNsfwBlocked ? (

{!ENABLE_MATURE && ( <> {__('Mature content is not supported.')} )} {ENABLE_MATURE && ( <> {__('Mature content blocked.')} )}

{ENABLE_MATURE && ( <> ), }} > Change this in your %content_settings%. )} {!ENABLE_MATURE && ( <> , }} > You can download the LBRY Desktop or Android app on %download_url% and enable mature content in Settings. )}
) : (
) } /> ); } export default FileTitleSection;