// 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 let infoString = 'File type ' + fileInfo.extension.toUpperCase(); if (fileInfo.size > 0) { infoString += ', Size ' + Utils.fileSizeToString(fileInfo.size); } const name = decodeURIComponent(Utils.getFileName(filename)); return (
{name}
{infoString}
); }