// @flow
import * as React from 'react';
import ReactMarkdown from 'react-markdown';
import Button from 'component/button';
import path from 'path';
type Props = {
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;