Skip to content

Commit 77baa14

Browse files
committed
Legg til last-ned-fil link for bilder, og download ikon
1 parent 6d67cfd commit 77baa14

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

xp-archive/client/contentPreview/filePreview/FilePreview.tsx

+11-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import { Link } from '@navikt/ds-react';
3+
import { DownloadIcon } from '@navikt/aksel-icons';
34
import { FileResponse } from '@common/shared/fetchUtils';
45
import style from './FilePreview.module.css';
56

@@ -19,13 +20,16 @@ export const FilePreview = ({ name, file }: Props) => {
1920
return <iframe className={style.iframe} src={blobURL} />;
2021
}
2122

22-
if (imageFiletype.includes(file.mimeType)) {
23-
return <img className={style.image} alt="" src={blobURL} />;
24-
}
25-
2623
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+
</>
3034
);
3135
};

0 commit comments

Comments
 (0)