1
1
import React from "react" ;
2
- import { IResourceComponentsProps , useTranslate , useInvalidate , useNavigation } from "@refinedev/core" ;
3
- import { useTable , List } from "@refinedev/antd" ;
2
+ import { IResourceComponentsProps , useTranslate , useInvalidate , useNavigation , useExport } from "@refinedev/core" ;
3
+ import { useTable , List , ExportButton } from "@refinedev/antd" ;
4
4
import { Table , Button , Dropdown } from "antd" ;
5
5
import dayjs from "dayjs" ;
6
6
import utc from "dayjs/plugin/utc" ;
@@ -24,6 +24,7 @@ import {
24
24
} from "../../components/otherModels" ;
25
25
import { useLiveify } from "../../components/liveify" ;
26
26
import { removeUndefined } from "../../utils/filtering" ;
27
+ import { IVendor } from "../vendors/model" ;
27
28
28
29
dayjs . extend ( utc ) ;
29
30
@@ -75,6 +76,8 @@ export const FilamentList: React.FC<IResourceComponentsProps> = () => {
75
76
// Load initial state
76
77
const initialState = useInitialTableState ( namespace ) ;
77
78
79
+ const { triggerExport, exportLoading } = useExport < IVendor > ( ) ;
80
+
78
81
// Fetch data from the API
79
82
// To provide the live updates, we use a custom solution (useLiveify) instead of the built-in refine "liveMode" feature.
80
83
// This is because the built-in feature does not call the liveProvider subscriber with a list of IDs, but instead
@@ -183,6 +186,9 @@ export const FilamentList: React.FC<IResourceComponentsProps> = () => {
183
186
</ Button >
184
187
</ Dropdown >
185
188
{ defaultButtons }
189
+ < ExportButton type = "dashed" onClick = { triggerExport } loading = { exportLoading } >
190
+ { t ( "buttons.export" ) }
191
+ </ ExportButton >
186
192
</ >
187
193
) }
188
194
>
0 commit comments