gdq-archive/frontend/components/DownloadButton.tsx

19 lines
635 B
TypeScript
Raw Normal View History

2020-08-22 20:25:57 +00:00
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 }) {
return (
<Button variant="success" href={getDownloadURL(id, fileName)}>
<FontAwesomeIcon icon="download" className="mr-2" />
<FormattedMessage
id="DownloadButton.download"
defaultMessage="Download"
description="Text of the download button"
/>
</Button>
);
}