@codesmith-99/react-file-preview
Advanced tools
Comparing version 1.0.26 to 1.0.27
@@ -5,2 +5,3 @@ var $8zHUo$reactjsxruntime = require("react/jsx-runtime"); | ||
var $8zHUo$styledcomponents = require("styled-components"); | ||
var $8zHUo$reactfileicon = require("react-file-icon"); | ||
var $8zHUo$commaseparatedvalues = require("comma-separated-values"); | ||
@@ -93,3 +94,4 @@ var $8zHUo$reactvirtuoso = require("react-virtuoso"); | ||
function $8a5c52d788c46910$export$2e2bcd8739ae039({ onLoad: onLoad }) { | ||
function $8a5c52d788c46910$export$2e2bcd8739ae039({ onLoad: onLoad , mimeType: mimeType }) { | ||
(0, $8zHUo$react.useEffect)(()=>{ | ||
@@ -101,3 +103,6 @@ onLoad(true); | ||
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("div", { | ||
children: "File can't be previewed" | ||
children: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $8zHUo$reactfileicon.FileIcon), { | ||
extension: mimeType, | ||
...(0, $8zHUo$reactfileicon.defaultStyles)[mimeType] | ||
}) | ||
}); | ||
@@ -319,3 +324,4 @@ } | ||
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $8a5c52d788c46910$export$2e2bcd8739ae039), { | ||
onLoad: onLoad | ||
onLoad: onLoad, | ||
mimeType: mimeType | ||
}); | ||
@@ -465,2 +471,3 @@ } | ||
const $4e8221c27276c1f0$var$Container = (0, ($parcel$interopDefault($8zHUo$styledcomponents))).div` | ||
@@ -496,3 +503,6 @@ height: 100%; | ||
if (showError) return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("div", { | ||
children: "Unfortunately, this file can't be previewed" | ||
children: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $8zHUo$reactfileicon.FileIcon), { | ||
extension: fileType, | ||
...(0, $8zHUo$reactfileicon.defaultStyles)[fileType] | ||
}) | ||
}); | ||
@@ -499,0 +509,0 @@ return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $8zHUo$reactjsxruntime.Fragment), { |
@@ -5,2 +5,3 @@ import {jsx as $hgUW1$jsx, jsxs as $hgUW1$jsxs, Fragment as $hgUW1$Fragment} from "react/jsx-runtime"; | ||
import $hgUW1$styledcomponents from "styled-components"; | ||
import {FileIcon as $hgUW1$FileIcon, defaultStyles as $hgUW1$defaultStyles} from "react-file-icon"; | ||
import $hgUW1$commaseparatedvalues from "comma-separated-values"; | ||
@@ -80,3 +81,4 @@ import {TableVirtuoso as $hgUW1$TableVirtuoso} from "react-virtuoso"; | ||
function $c756ca1a2edcb3f2$export$2e2bcd8739ae039({ onLoad: onLoad }) { | ||
function $c756ca1a2edcb3f2$export$2e2bcd8739ae039({ onLoad: onLoad , mimeType: mimeType }) { | ||
(0, $hgUW1$useEffect)(()=>{ | ||
@@ -88,3 +90,6 @@ onLoad(true); | ||
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", { | ||
children: "File can't be previewed" | ||
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$FileIcon), { | ||
extension: mimeType, | ||
...(0, $hgUW1$defaultStyles)[mimeType] | ||
}) | ||
}); | ||
@@ -306,3 +311,4 @@ } | ||
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $c756ca1a2edcb3f2$export$2e2bcd8739ae039), { | ||
onLoad: onLoad | ||
onLoad: onLoad, | ||
mimeType: mimeType | ||
}); | ||
@@ -452,2 +458,3 @@ } | ||
const $f36e68bdd4eff097$var$Container = (0, $hgUW1$styledcomponents).div` | ||
@@ -483,3 +490,6 @@ height: 100%; | ||
if (showError) return /*#__PURE__*/ (0, $hgUW1$jsx)("div", { | ||
children: "Unfortunately, this file can't be previewed" | ||
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$FileIcon), { | ||
extension: fileType, | ||
...(0, $hgUW1$defaultStyles)[fileType] | ||
}) | ||
}); | ||
@@ -486,0 +496,0 @@ return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), { |
{ | ||
"name": "@codesmith-99/react-file-preview", | ||
"version": "1.0.26", | ||
"version": "1.0.27", | ||
"description": "", | ||
@@ -53,2 +53,3 @@ "source": "src/index.ts", | ||
"@types/react-dom": "^18.0.10", | ||
"@types/react-file-icon": "^1.0.1", | ||
"@types/react-table": "^7.7.14", | ||
@@ -76,2 +77,3 @@ "@types/styled-components": "^5.1.26", | ||
"react": "^18.2.0", | ||
"react-file-icon": "^1.3.0", | ||
"react-virtuoso": "^4.0.3", | ||
@@ -78,0 +80,0 @@ "styled-components": "^5.3.6" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
78320
925
6
23
+ Addedreact-file-icon@^1.3.0
+ Addedcolord@2.9.3(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedprop-types@15.8.1(transitive)
+ Addedreact-dom@18.3.1(transitive)
+ Addedreact-file-icon@1.5.0(transitive)
+ Addedscheduler@0.23.2(transitive)
- Removedreact@19.0.0(transitive)
- Removedreact-dom@19.0.0(transitive)
- Removedreact-is@19.0.0(transitive)
- Removedscheduler@0.25.0(transitive)