import classNames from 'classnames'; import React, { useEffect, useState } from 'react'; import { downloadAs, DownloadType } from '../../data-entry/utils'; interface Props { id?: string; setProps?: (value: any) => any; className?: string; data: any; filename?: string; filetype?: DownloadType; tooltip?: string; } export const DownloadButton: React.FC = ({ filename = 'export', filetype = 'json', ...otherProps }) => { const props = { filename, filetype, ...otherProps }; const [data, setData] = useState(props.data); useEffect(() => { setData(props.data); }, [props.data]); return ( ); };