Parameterize download button icon.
parent
f7b67355c4
commit
0184eff590
|
@ -1,13 +1,22 @@
|
|||
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import React from 'react';
|
||||
import { Button } from 'react-bootstrap';
|
||||
import { getDownloadURL } from 'util/api';
|
||||
import { FormattedMessage } from './localization';
|
||||
|
||||
export default function DownloadButton({ id, fileName }: { id: string, fileName: string }) {
|
||||
export default function DownloadButton({
|
||||
icon = 'download',
|
||||
id,
|
||||
fileName,
|
||||
}: {
|
||||
icon?: IconProp,
|
||||
id: string,
|
||||
fileName: string
|
||||
}) {
|
||||
return (
|
||||
<Button variant="success" href={getDownloadURL(id, fileName)}>
|
||||
<FontAwesomeIcon icon="download" className="mr-2" />
|
||||
<FontAwesomeIcon icon={icon} className="mr-2" />
|
||||
<FormattedMessage
|
||||
id="DownloadButton.download"
|
||||
defaultMessage="Download"
|
||||
|
|
Loading…
Reference in New Issue