// @flow import * as React from 'react'; import MarkdownPreview from 'component/markdownPreview'; import Button from 'component/button'; import path from 'path'; import type { Claim } from 'types/claim'; type Props = { claim: Claim, fileInfo: { download_path: string, }, metadata: { description: string, language: string, license: string, }, openFolder: string => void, contentType: string, }; const FileDetails = (props: Props) => { const { claim, contentType, fileInfo, metadata, openFolder } = 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')} {': '}
)}
); }; export default FileDetails;