@afzalimdad9/react-file-preview
Version:
The url previewer is built using native html elements for previewing url of files of the following type
17 lines • 738 B
JavaScript
import { __assign } from "tslib";
import { jsx as _jsx } from "react/jsx-runtime";
import { useEffect } from 'react';
import { FileIcon, defaultStyles } from 'react-file-icon';
import MimeTypes from 'mime';
export default function DefaultViewer(_a) {
var _b;
var onLoad = _a.onLoad, mimeType = _a.mimeType;
useEffect(function () {
onLoad(true);
}, [onLoad]);
return (_jsx("div", __assign({ style: {
width: '50px',
height: '50px'
} }, { children: _jsx(FileIcon, __assign({ extension: (_b = MimeTypes.getExtension(mimeType)) !== null && _b !== void 0 ? _b : '' }, defaultStyles[MimeTypes.getExtension(mimeType)])) })));
}
//# sourceMappingURL=default-viewer.js.map