lbry-desktop/ui/component/claimPreviewTitle/view.jsx

27 lines
564 B
React
Raw Normal View History

// @flow
import React from 'react';
import TruncatedText from 'component/common/truncated-text';
import { stripLeadingAtSign } from 'util/string';
type Props = {
uri: string,
claim: ?Claim,
title: string,
};
2020-01-30 23:25:15 +01:00
function ClaimPreviewTitle(props: Props) {
const { title, claim } = props;
2020-03-19 15:38:20 +01:00
return (
2020-01-30 23:25:15 +01:00
<div className="claim-preview__title">
{claim ? (
<TruncatedText text={title || stripLeadingAtSign(claim.name)} lines={2} />
) : (
<span>{__('Nothing here')}</span>
)}
</div>
);
}
2020-01-30 23:25:15 +01:00
export default ClaimPreviewTitle;