Created button to use when anything needs to be exported

This commit is contained in:
Alejandro Celaya
2022-03-12 20:51:30 +01:00
parent 187e26810d
commit 7fd360495b
7 changed files with 57 additions and 35 deletions

17
src/utils/ExportBtn.tsx Normal file
View File

@@ -0,0 +1,17 @@
import { FC } from 'react';
import { Button } from 'reactstrap';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faFileDownload } from '@fortawesome/free-solid-svg-icons';
import { prettify } from './helpers/numbers';
interface ExportBtnProps {
onClick: () => void;
amount?: number;
className?: string;
}
export const ExportBtn: FC<ExportBtnProps> = ({ onClick, className, amount = 0 }) => (
<Button outline color="primary" className={className} onClick={onClick}>
<FontAwesomeIcon icon={faFileDownload} /> Export ({prettify(amount)})
</Button>
);