@@ -8,7 +8,7 @@ import paginationRightSVG from '@plone/volto/icons/right-key.svg';
8
8
import sortUp from '@plone/volto/icons/sort-up.svg' ;
9
9
import sortDown from '@plone/volto/icons/sort-down.svg' ;
10
10
import { defineMessages , useIntl } from 'react-intl' ;
11
- import { CSVLink } from 'react-csv ' ;
11
+ import TableActions from '@eeacms/volto- react-table-widget/components/Blocks/DataTableBlock/TableActions ' ;
12
12
13
13
const messages = defineMessages ( {
14
14
page_size : {
@@ -19,10 +19,6 @@ const messages = defineMessages({
19
19
id : 'all' ,
20
20
defaultMessage : 'All' ,
21
21
} ,
22
- export_csv_file : {
23
- id : 'Export CSV file' ,
24
- defaultMessage : 'Export CSV file' ,
25
- } ,
26
22
} ) ;
27
23
28
24
const View = ( { data, id, path, properties } ) => {
@@ -180,7 +176,7 @@ const View = ({ data, id, path, properties }) => {
180
176
>
181
177
{ column . render ( 'Header' ) }
182
178
{ column . defaultCanSort && (
183
- < span class = "sort" >
179
+ < span className = "sort" >
184
180
{ column . isSorted ? (
185
181
column . isSortedDesc ? (
186
182
< Icon name = { sortUp } />
@@ -260,17 +256,13 @@ const View = ({ data, id, path, properties }) => {
260
256
</ select >
261
257
</ >
262
258
) }
263
- < div className = "actions" >
264
- < CSVLink
265
- className = "ui button"
266
- filename = { schema . title ? `${ schema . title } .csv` : 'export.csv' }
267
- separator = ";"
268
- headers = { csv_columns }
269
- data = { data ?. items || [ ] }
270
- >
271
- { intl . formatMessage ( messages . export_csv_file ) }
272
- </ CSVLink >
273
- </ div >
259
+ < TableActions
260
+ path = { path }
261
+ block_id = { id }
262
+ schema = { schema }
263
+ columns = { csv_columns }
264
+ items = { data ?. items || [ ] }
265
+ />
274
266
</ div >
275
267
) }
276
268
</ div >
0 commit comments