mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2025-01-08 09:17:29 +03:00
16 lines
659 B
TypeScript
16 lines
659 B
TypeScript
import { FC } from 'react';
|
|
import { Button, ButtonProps } from 'reactstrap';
|
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
import { faFileCsv } from '@fortawesome/free-solid-svg-icons';
|
|
import { prettify } from './helpers/numbers';
|
|
|
|
interface ExportBtnProps extends Omit<ButtonProps, 'outline' | 'color' | 'disabled'> {
|
|
amount?: number;
|
|
loading?: boolean;
|
|
}
|
|
|
|
export const ExportBtn: FC<ExportBtnProps> = ({ amount = 0, loading = false, ...rest }) => (
|
|
<Button {...rest} outline color="primary" disabled={loading}>
|
|
<FontAwesomeIcon icon={faFileCsv} /> {loading ? 'Exporting...' : <>Export ({prettify(amount)})</>}
|
|
</Button>
|
|
);
|