UNPKG

@datalayer/core

Version:
17 lines (16 loc) 632 B
import { jsx as _jsx } from "react/jsx-runtime"; /* * Copyright (c) 2023-2025 Datalayer, Inc. * Distributed under the terms of the Modified BSD License. */ import { Button } from '@primer/react'; import { DownloadIcon } from '@primer/octicons-react'; import { downloadCSV } from '../../utils'; export const DownloadCSVButton = (props) => { const { data, fileName, variant } = props; return (_jsx(Button, { variant: variant, leadingVisual: DownloadIcon, onClick: e => downloadCSV(data, fileName), children: "Download" })); }; DownloadCSVButton.defaultProps = { variant: "default", }; export default DownloadCSVButton;