// @flow import type { Claim, Metadata } from 'types/claim'; import type { FileInfo } from 'types/file_info'; import React, { Fragment, PureComponent } from 'react'; import { Lbryio } from 'lbryinc'; import MarkdownPreview from 'component/common/markdown-preview'; import Button from 'component/button'; import path from 'path'; import Expandable from 'component/expandable'; type Props = { claim: Claim, fileInfo: FileInfo, metadata: Metadata, openFolder: string => void, contentType: string, clickCommentButton: () => void, showSnackBar: string => void, hasClickedComment: boolean, user: ?any, }; class FileDetails extends PureComponent { constructor() { super(); (this: any).handleCommentClick = this.handleCommentClick.bind(this); } handleCommentClick() { const { clickCommentButton, showSnackBar } = this.props; clickCommentButton(); Lbryio.call('user_tag', 'edit', { add: 'comments-waitlist' }); showSnackBar(__('Thanks! Comments are coming soon(ish).')); } render() { const { claim, contentType, fileInfo, metadata, openFolder, hasClickedComment, user, } = this.props; if (!claim || !metadata) { return (
{__('Empty claim or metadata info.')}
); } const { description, language, license } = metadata; const mediaType = contentType || 'unknown'; const downloadPath = fileInfo ? path.normalize(fileInfo.download_path) : null; return ( {description && (
About
)}
Info
{__('Content-Type')} {': '} {mediaType}
{__('Language')} {': '} {language}
{__('License')} {': '} {license}
{downloadPath && (
{__('Downloaded to')} {': '}
)}
Comments
{hasClickedComment && (

{user ? __( 'Your support has been added. You will be notified when comments are available.' ) : __('Your support has been added. Comments are coming soon.')}

)}
); } } export default FileDetails;