File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @omarefg/react-file-preview" ,
3
- "version" : " 0.1.12 " ,
3
+ "version" : " 0.1.13 " ,
4
4
"description" : " Component to render and preview some kind of documents" ,
5
5
"main" : " lib/index.js" ,
6
6
"private" : false ,
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { Video } from './Video'
8
8
import { Unssuported } from './Unsupported'
9
9
import { Csv } from './Csv'
10
10
import { Xlsx } from './Xlsx'
11
+ import { Loader } from './Loader'
11
12
12
13
export const Viewer = props => {
13
14
const {
@@ -23,8 +24,18 @@ export const Viewer = props => {
23
24
pageSize,
24
25
showPdfMenu,
25
26
onPrint,
27
+ isLoading,
26
28
} = props
27
29
30
+ if ( isLoading ) {
31
+ return (
32
+ < Loader
33
+ ErrorComponent = { ErrorComponent }
34
+ onError = { onError }
35
+ />
36
+ )
37
+ }
38
+
28
39
switch ( type ) {
29
40
case 'csv' : {
30
41
return (
@@ -141,6 +152,7 @@ Viewer.propTypes = {
141
152
showPdfMenu : bool ,
142
153
onPrint : func ,
143
154
className : string ,
155
+ isLoading : bool ,
144
156
}
145
157
146
158
Viewer . defaultProps = {
@@ -154,4 +166,5 @@ Viewer.defaultProps = {
154
166
showPdfMenu : true ,
155
167
onPrint : null ,
156
168
className : null ,
169
+ isLoading : false ,
157
170
}
You can’t perform that action at this time.
0 commit comments