11import { Box , Pagination , Text , rem , type MantineSpacing , type MantineStyleProp } from '@mantine/core' ;
22import clsx from 'clsx' ;
3- import { forwardRef , type ForwardedRef , type JSX } from 'react' ;
3+ import { type ForwardedRef } from 'react' ;
44import { DataTablePageSizeSelector } from './DataTablePageSizeSelector' ;
55import { getPaginationCssVariables } from './cssVariables' ;
66import { useMediaQueryStringOrFunction } from './hooks' ;
@@ -20,35 +20,34 @@ type DataTablePaginationComponentProps = WithOptionalProperty<
2020 recordsLength : number | undefined ;
2121 horizontalSpacing : MantineSpacing | undefined ;
2222 noRecordsText : string ;
23+ ref : ForwardedRef < HTMLDivElement > ;
2324} ;
2425
25- export const DataTablePagination = forwardRef ( function DataTablePagination (
26- {
27- className,
28- style,
29- fetching,
30- page,
31- onPageChange,
32- paginationWithEdges,
33- paginationWithControls,
34- paginationActiveTextColor,
35- paginationActiveBackgroundColor,
36- paginationSize,
37- loadingText,
38- noRecordsText,
39- paginationText,
40- totalRecords,
41- recordsPerPage,
42- onRecordsPerPageChange,
43- recordsPerPageLabel,
44- recordsPerPageOptions,
45- recordsLength,
46- horizontalSpacing,
47- paginationWrapBreakpoint,
48- getPaginationControlProps,
49- } : DataTablePaginationComponentProps ,
50- ref : ForwardedRef < HTMLDivElement >
51- ) {
26+ export function DataTablePagination ( {
27+ className,
28+ style,
29+ fetching,
30+ page,
31+ onPageChange,
32+ paginationWithEdges,
33+ paginationWithControls,
34+ paginationActiveTextColor,
35+ paginationActiveBackgroundColor,
36+ paginationSize,
37+ loadingText,
38+ noRecordsText,
39+ paginationText,
40+ totalRecords,
41+ recordsPerPage,
42+ onRecordsPerPageChange,
43+ recordsPerPageLabel,
44+ recordsPerPageOptions,
45+ recordsLength,
46+ horizontalSpacing,
47+ paginationWrapBreakpoint,
48+ getPaginationControlProps,
49+ ref,
50+ } : DataTablePaginationComponentProps ) {
5251 let paginationTextValue : React . ReactNode ;
5352 if ( totalRecords ) {
5453 const from = ( page - 1 ) * recordsPerPage + 1 ;
@@ -112,4 +111,4 @@ export const DataTablePagination = forwardRef(function DataTablePagination(
112111 />
113112 </ Box >
114113 ) ;
115- } ) as ( props : DataTablePaginationComponentProps & { ref : ForwardedRef < HTMLDivElement > } ) => JSX . Element ;
114+ }
0 commit comments