UNPKG

contiago-toolbar

Version:

One of the options for outputting content from contiago xml-server

23 lines (20 loc) 671 B
import React from 'react'; import { convertImagePathToUrl } from 'utils/imagesUtil'; import Wrapper from './Wrapper'; import DownloadIcon from './DownloadIcon'; import FileDescription from './FileDescription'; import Download from './Download'; const FileItem = ({ file }) => { const { title, path } = file; const size = file.size / 1000 > 1 ? (file.size / 1000).toFixed(2) : '< 1'; const link = convertImagePathToUrl(path); return ( <Download href={link.replace(/'/g, '')} download> <Wrapper> <DownloadIcon /> <FileDescription title={title} size={size} path={path} /> </Wrapper> </Download> ); }; export default FileItem;