@@ -288,18 +288,19 @@ const Pages = () => {
288288 } ;
289289
290290 // handlers for updating property on pages
291- const [ selectedProperty , setSelectedProperty ] = useState ( " Select a Property" ) ;
291+ const [ selectedProperty , setSelectedProperty ] = useState ( ' Select a Property' ) ;
292292 useEffect ( ( ) => {
293293 updateSelectedPagesProperty ( ) ;
294294 return ;
295295 } , [ selectedProperty ] ) ;
296-
296+
297297 const updateSelectedPagesProperty = async ( ) => {
298298 const urlsToSend = table . getSelectedRowModel ( ) . flatRows . map ( ( row ) => {
299299 return row . original . id ;
300300 } ) ;
301- if ( urlsToSend . length === 0 || selectedProperty == "Select a Property" ) return ;
302- console . log ( "Updating property..." ) ;
301+ if ( urlsToSend . length === 0 || selectedProperty == 'Select a Property' )
302+ return ;
303+ console . log ( 'Updating property...' ) ;
303304 console . log ( urlsToSend , selectedProperty ) ;
304305
305306 try {
@@ -329,8 +330,8 @@ const Pages = () => {
329330 } ) ;
330331 console . log ( urlsToSend , selectedProperty ) ;
331332 throw error ;
332- }
333- setSelectedProperty ( " Select a Property" ) ;
333+ }
334+ setSelectedProperty ( ' Select a Property' ) ;
334335 table . resetRowSelection ( ) ;
335336 dataQuery . refetch ( ) ;
336337 } ;
@@ -429,12 +430,14 @@ const Pages = () => {
429430 < ChevronUpIcon />
430431 </ Select . ScrollUpButton >
431432 < Select . Viewport className = "SelectViewport" >
432- < Select . Item
433+ < Select . Item
433434 value = "Select a Property"
434435 key = "Select a Property"
435436 className = "cursor-pointer p-2 hover:bg-green-100"
436437 >
437- < Select . ItemText > Select a Property...</ Select . ItemText >
438+ < Select . ItemText >
439+ Select a Property...
440+ </ Select . ItemText >
438441 </ Select . Item >
439442 < Select . Item
440443 value = "null"
@@ -512,45 +515,42 @@ const Pages = () => {
512515 < nav
513516 role = "navigation"
514517 aria-label = "Pagination Navigation"
515- className = "flex items-center gap-2"
518+ className = "flex items-center gap-2 pt-2 "
516519 >
517520 < button
518- className = "rounded border p-1 "
521+ className = "hover:bg-accent hover:text-accent-foreground hidden h-8 w-8 items-center justify-center whitespace-nowrap rounded-md border border-gray-300 bg-transparent p-0 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#1D781D] focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 lg:flex "
519522 onClick = { ( ) => table . firstPage ( ) }
520523 disabled = { ! table . getCanPreviousPage ( ) }
521524 >
522525 { '<<' }
523526 </ button >
524527 < button
525- className = "rounded border p-1 "
528+ className = "hover:bg-accent hover:text-accent-foreground hidden h-8 w-8 items-center justify-center whitespace-nowrap rounded-md border border-gray-300 bg-transparent p-0 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#1D781D] focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 lg:flex "
526529 onClick = { ( ) => table . previousPage ( ) }
527530 disabled = { ! table . getCanPreviousPage ( ) }
528531 >
529532 { '<' }
530533 </ button >
531534 < button
532- className = "rounded border p-1 "
535+ className = "hover:bg-accent hover:text-accent-foreground hidden h-8 w-8 items-center justify-center whitespace-nowrap rounded-md border border-gray-300 bg-transparent p-0 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#1D781D] focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 lg:flex "
533536 onClick = { ( ) => table . nextPage ( ) }
534537 disabled = { ! table . getCanNextPage ( ) }
535538 >
536539 { '>' }
537540 </ button >
538541 < button
539- className = "rounded border p-1 "
542+ className = "hover:bg-accent hover:text-accent-foreground hidden h-8 w-8 items-center justify-center whitespace-nowrap rounded-md border border-gray-300 bg-transparent p-0 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#1D781D] focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 lg:flex "
540543 onClick = { ( ) => table . lastPage ( ) }
541544 disabled = { ! table . getCanNextPage ( ) }
542545 >
543546 { '>>' }
544547 </ button >
545- < span className = "flex items-center gap-1" >
546- < div > Page</ div >
547- < strong >
548- { table . getState ( ) . pagination . pageIndex + 1 } of{ ' ' }
549- { table . getPageCount ( ) . toLocaleString ( ) }
550- </ strong >
548+ < span className = "flex w-[100px] items-center justify-center text-sm font-medium" >
549+ Page { table . getState ( ) . pagination . pageIndex + 1 } of{ ' ' }
550+ { table . getPageCount ( ) . toLocaleString ( ) }
551551 </ span >
552- < span className = "flex items-center gap-1 " >
553- | Go to page:
552+ { /* <span className="flex w-[100px] items-center justify-center text-sm font-medium ">
553+ <span> | Go to page:</span>
554554 <input
555555 type="number"
556556 min="1"
@@ -564,26 +564,52 @@ const Pages = () => {
564564 }}
565565 className="w-16 rounded border p-1"
566566 />
567- </ span >
568- < select
569- value = { table . getState ( ) . pagination . pageSize }
570- onChange = { ( e ) => {
571- table . setPageSize ( Number ( e . target . value ) ) ;
567+ </span> */ }
568+ < Select . Root
569+ value = { table . getState ( ) . pagination . pageSize . toString ( ) }
570+ onValueChange = { ( val ) => {
571+ table . setPageSize ( Number ( val ) ) ;
572572 } }
573573 >
574- { [ 10 , 20 , 30 , 40 , 50 ] . map ( ( pageSize ) => (
575- < option key = { pageSize } value = { pageSize } >
576- Show { pageSize }
577- </ option >
578- ) ) }
579- </ select >
580- { dataQuery . isFetching ? 'Loading...' : null }
581- </ nav >
582-
583- < div >
574+ < Select . Trigger
575+ className = "SelectTrigger border border-slate-200"
576+ aria-label = "Pagination Page Size"
577+ >
578+ < Select . Value placeholder = "Select Pages to Show…" />
579+ < Select . Icon className = "SelectIcon" >
580+ < ChevronDownIcon />
581+ </ Select . Icon >
582+ </ Select . Trigger >
583+ < Select . Portal >
584+ < Select . Content className = "SelectContent" >
585+ < Select . ScrollUpButton className = "SelectScrollButton" >
586+ < ChevronUpIcon />
587+ </ Select . ScrollUpButton >
588+ < Select . Viewport className = "SelectViewport" >
589+ { [ 10 , 20 , 30 , 40 , 50 ] . map ( ( pageSize ) => (
590+ < Select . Item
591+ value = { pageSize . toString ( ) }
592+ key = { pageSize }
593+ className = "cursor-pointer p-2 hover:bg-green-100"
594+ >
595+ < Select . ItemText > Show { pageSize } </ Select . ItemText >
596+ </ Select . Item >
597+ ) ) }
598+ </ Select . Viewport >
599+ < Select . ScrollDownButton className = "SelectScrollButton" >
600+ < ChevronDownIcon />
601+ </ Select . ScrollDownButton >
602+ </ Select . Content >
603+ </ Select . Portal >
604+ </ Select . Root >
605+ { dataQuery . isFetching ? < ReloadIcon aria-label = "Loading..." className = "animate-spin" /> : null }
606+ < div className = "w-[200px] items-center justify-center text-sm font-medium" >
584607 Showing { table . getRowModel ( ) . rows . length . toLocaleString ( ) } of{ ' ' }
585608 { dataQuery . data ?. total . toLocaleString ( ) }
586609 </ div >
610+ </ nav >
611+
612+
587613 </ div >
588614 </ div >
589615 < a id = "downloadReportLink" style = { { display : 'none' } } > </ a >
0 commit comments