// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. import * as Utils from '../utils/utils.jsx'; export default function FileInfoPreview({filename, fileUrl, fileInfo}) { // non-image files include a section providing details about the file const infoParts = []; if (fileInfo.extension !== '') { infoParts.push('File type ' + fileInfo.extension.toUpperCase()); } infoParts.push('Size ' + Utils.fileSizeToString(fileInfo.size)); const infoString = infoParts.join(', '); const name = decodeURIComponent(Utils.getFileName(filename)); return (
{name}
{infoString}
); }