@kadconsulting/dry
Version:
KAD Reusable Component Library
12 lines • 1.35 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { forwardRef } from 'react';
import classnames from 'classnames';
import { CSVLink } from 'react-csv';
// import * as Utils from "./ExportCSVButton.utils.js";
import './ExportCSVButton.scss';
const ExportCSVButton = forwardRef(({ id, className, data, headers }, ref) => {
// TODO-p1: this needs to be made into a generic component that can be used for any table
return (_jsx("div", { id: id, ref: ref, className: classnames(className, 'dry-export-csv-button'), children: _jsxs(CSVLink, { data: data, headers: headers, filename: 'dashboard_data.csv', className: 'dry-export-csv-button__link', children: [_jsx("svg", { xmlns: 'http://www.w3.org/2000/svg', width: '20', height: '20', viewBox: '0 0 20 20', fill: 'none', children: _jsx("path", { d: 'M17.5 12.5V13.5C17.5 14.9001 17.5 15.6002 17.2275 16.135C16.9878 16.6054 16.6054 16.9878 16.135 17.2275C15.6002 17.5 14.9001 17.5 13.5 17.5H6.5C5.09987 17.5 4.3998 17.5 3.86502 17.2275C3.39462 16.9878 3.01217 16.6054 2.77248 16.135C2.5 15.6002 2.5 14.9001 2.5 13.5V12.5M14.1667 8.33333L10 12.5M10 12.5L5.83333 8.33333M10 12.5V2.5', stroke: '#344054', strokeWidth: '1.66667', strokeLinecap: 'round', strokeLinejoin: 'round' }) }), "Export"] }) }));
});
export default ExportCSVButton;
//# sourceMappingURL=ExportCSVButton.js.map