updates on the ui changes and changed into doormile
This commit is contained in:
42
src/components/third-party/ReactTable.jsx
vendored
Normal file
42
src/components/third-party/ReactTable.jsx
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
// third-party
|
||||
import { CSVLink } from 'react-csv';
|
||||
import { MdDownload } from 'react-icons/md';
|
||||
|
||||
import { Button } from '@astryxdesign/core/Button';
|
||||
|
||||
// ==============================|| CSV EXPORT ||============================== //
|
||||
// This file used to be Mantis's 596-line react-table v7 toolkit — HeaderSort,
|
||||
// TablePagination, IndeterminateCheckbox, TableRowSelection, DraggableHeader,
|
||||
// DragPreview, DraggableRow, HidingSelect, SortingSelect, EmptyTable. None of
|
||||
// them were imported anywhere: the two consumers (dispatch/Preview.js and
|
||||
// reports/ordersDetails.js) only ever pulled `CSVExport`. Rather than port ten
|
||||
// dead helpers to Astryx, they were deleted and only the export button remains.
|
||||
|
||||
export const CSVExport = ({ data, filename, headers, label, style, btnLoading, onClick }) => (
|
||||
<CSVLink data={data} filename={filename} headers={headers} style={{ textDecoration: 'none' }}>
|
||||
<Button
|
||||
label={label || 'Download'}
|
||||
icon={btnLoading ? undefined : <MdDownload />}
|
||||
variant={btnLoading ? 'secondary' : 'primary'}
|
||||
isLoading={btnLoading}
|
||||
isDisabled={btnLoading}
|
||||
tooltip="CSV Export"
|
||||
style={style}
|
||||
onClick={(e) => onClick?.(e)}
|
||||
/>
|
||||
</CSVLink>
|
||||
);
|
||||
|
||||
CSVExport.propTypes = {
|
||||
data: PropTypes.array,
|
||||
headers: PropTypes.any,
|
||||
filename: PropTypes.string,
|
||||
label: PropTypes.any,
|
||||
style: PropTypes.object,
|
||||
btnLoading: PropTypes.any,
|
||||
onClick: PropTypes.func
|
||||
};
|
||||
|
||||
export default CSVExport;
|
||||
Reference in New Issue
Block a user