improved export button

This commit is contained in:
juhanikat
2025-05-27 16:22:50 +03:00
parent d9b26b0fe2
commit f63118aa0d
@@ -29,30 +29,6 @@ type TableStateInUrl = 'sorting' | 'columnfilters' | 'pagination'
selectorFn should only be defined if using this as a selecting table
*/
const CrossSearchExportButton = () => {
// loading is set to false after a timeout because actually knowing
// once the file is downloaded is impossible when implemented this way
const [loading, setLoading] = useState(false)
return (
<Box>
<Button
href={`${BACKEND_URL}/crosssearch/export`}
onClick={() => {
setLoading(true)
setTimeout(() => {
setLoading(false)
}, 20000)
}}
variant="contained"
disabled={loading}
>
Export cross search table
</Button>
{loading && <CircularProgress />}
</Box>
)
}
export const TableView = <T extends MRT_RowData>({
data,
columns,