Skip to content

Commit c3928bb

Browse files
committed
use graphqlPagination
1 parent 6167126 commit c3928bb

1 file changed

Lines changed: 19 additions & 14 deletions

File tree

  • app/[locale]/dashboard/user/datasets

app/[locale]/dashboard/user/datasets/page.tsx

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
import { useEffect, useState } from 'react';
44
import { useRouter } from 'next/navigation';
5+
import { DataTable } from 'opub-ui';
56

6-
import GraphqlTable from '../../components/GraphqlTable/graphqlTable';
7+
import GraphqlPagination from '../../components/GraphqlPagination/graphqlPagination';
78
import ListingHeader from '../../components/ListingHeader';
89

910
const Page = () => {
@@ -97,9 +98,15 @@ const Page = () => {
9798
count={120}
9899
label={'datasets'}
99100
/>
100-
<GraphqlTable
101-
table={{
102-
columns: [
101+
<GraphqlPagination
102+
totalRows={totalRows}
103+
pageSize={queryParams.pageSize}
104+
currentPage={queryParams.currentPage}
105+
onPageChange={handlePageChange}
106+
onPageSizeChange={handlePageSizeChange}
107+
>
108+
<DataTable
109+
columns={[
103110
{
104111
accessorKey: 'dataset_title',
105112
header: 'Dataset',
@@ -112,19 +119,17 @@ const Page = () => {
112119
accessorKey: 'org_types',
113120
header: '0rg Type',
114121
},
115-
],
116-
rows: rowData.map((item: any) => ({
122+
]}
123+
rows={rowData.map((item: any) => ({
117124
dataset_title: item._source.dataset_title,
118125
org_title: item._source.org_title,
119126
org_types: item._source.org_types,
120-
})),
121-
}}
122-
totalRows={totalRows}
123-
pageSize={queryParams.pageSize}
124-
currentPage={queryParams.currentPage}
125-
onPageChange={handlePageChange}
126-
onPageSizeChange={handlePageSizeChange}
127-
/>
127+
}))}
128+
hideFooter={true}
129+
hideSelection={true}
130+
defaultRowCount={100}
131+
/>
132+
</GraphqlPagination>
128133
</div>
129134
);
130135
};

0 commit comments

Comments
 (0)