File tree 1 file changed +11
-7
lines changed
xp-archive/client/contentPreview/filePreview
1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import { Link } from '@navikt/ds-react' ;
3
+ import { DownloadIcon } from '@navikt/aksel-icons' ;
3
4
import { FileResponse } from '@common/shared/fetchUtils' ;
4
5
import style from './FilePreview.module.css' ;
5
6
@@ -19,13 +20,16 @@ export const FilePreview = ({ name, file }: Props) => {
19
20
return < iframe className = { style . iframe } src = { blobURL } /> ;
20
21
}
21
22
22
- if ( imageFiletype . includes ( file . mimeType ) ) {
23
- return < img className = { style . image } alt = "" src = { blobURL } /> ;
24
- }
25
-
26
23
return (
27
- < Link href = { blobURL } target = { '_blank' } >
28
- { name }
29
- </ Link >
24
+ < >
25
+ { imageFiletype . includes ( file . mimeType ) ? (
26
+ < img className = { style . image } alt = "" src = { blobURL } />
27
+ ) : null }
28
+ < div >
29
+ < Link href = { blobURL } target = { '_blank' } >
30
+ { name } < DownloadIcon title = "Last ned fil" />
31
+ </ Link >
32
+ </ div >
33
+ </ >
30
34
) ;
31
35
} ;
You can’t perform that action at this time.
0 commit comments