StatsExport
Dropdown button that triggers asynchronous CSV or JSON export. Shows a spinner while the corresponding handler is awaited.
Dropdown button that triggers asynchronous CSV or JSON export. Shows a spinner while the corresponding handler is awaited.
import { StatsExport } from "@tetherto/mdk-react-devkit";| Prop | Status | Type | Default | Description |
|---|---|---|---|---|
showLabel | Optional | boolean | undefined | — | — |
disabled | Optional | boolean | undefined | — | — |
onCsvExport | Required | () => Promise<void> | — | — |
onJsonExport | Required | () => Promise<void> | — | — |
Usage
Dropdown button that triggers asynchronous CSV or JSON export. Shows a spinner while the corresponding handler is awaited.
Example
/** * Runnable example for StatsExport. */import { StatsExport } from '@tetherto/mdk-react-devkit'export const StatsExportExample = () => { return ( <StatsExport onCsvExport={async () => { await new Promise((r) => setTimeout(r, 800)) // eslint-disable-next-line no-console console.log('export csv') }} onJsonExport={async () => { await new Promise((r) => setTimeout(r, 800)) // eslint-disable-next-line no-console console.log('export json') }} showLabel /> )}