@@ -2,7 +2,7 @@ import React, { useMemo } from 'react';
22import { type MRT_Cell , type MRT_ColumnDef } from 'material-react-table' ;
33import { format } from 'date-fns' ;
44import { type GTFSFeedMetrics } from '../types' ;
5- import { useNavigate } from 'react-router-dom ' ;
5+ import { useRouter } from 'next/navigation ' ;
66import { Box , IconButton , MenuItem , Stack , Tooltip } from '@mui/material' ;
77import { OpenInNew } from '@mui/icons-material' ;
88import {
@@ -30,7 +30,7 @@ export const useTableColumns = (
3030 avgWarnings : number ,
3131 avgInfos : number ,
3232) : Array < MRT_ColumnDef < GTFSFeedMetrics > > => {
33- const navigate = useNavigate ( ) ;
33+ const router = useRouter ( ) ;
3434
3535 return useMemo < Array < MRT_ColumnDef < GTFSFeedMetrics > > > (
3636 ( ) => [
@@ -166,7 +166,7 @@ export const useTableColumns = (
166166 } }
167167 className = { 'navigable-list-item' }
168168 onClick = { ( ) => {
169- navigate ( `/metrics/gtfs/notices?noticeCode=${ error } ` ) ;
169+ router . push ( `/metrics/gtfs/notices?noticeCode=${ error } ` ) ;
170170 } }
171171 >
172172 { error }
@@ -208,7 +208,7 @@ export const useTableColumns = (
208208 } }
209209 className = { 'navigable-list-item' }
210210 onClick = { ( ) => {
211- navigate ( `/metrics/gtfs/notices?noticeCode=${ warning } ` ) ;
211+ router . push ( `/metrics/gtfs/notices?noticeCode=${ warning } ` ) ;
212212 } }
213213 >
214214 { warning }
@@ -258,7 +258,7 @@ export const useTableColumns = (
258258 } }
259259 className = { 'navigable-list-item' }
260260 onClick = { ( ) => {
261- navigate ( `/metrics/gtfs/notices?noticeCode=${ info } ` ) ;
261+ router . push ( `/metrics/gtfs/notices?noticeCode=${ info } ` ) ;
262262 } }
263263 >
264264 { info }
@@ -318,7 +318,7 @@ export const useTableColumns = (
318318 style = { { cursor : 'pointer' , marginLeft : '10px' } }
319319 className = { 'navigable-list-item' }
320320 onClick = { ( ) => {
321- navigate (
321+ router . push (
322322 `/metrics/gtfs/features?featureName=${ featureData . feature } ` ,
323323 ) ;
324324 } }
@@ -349,7 +349,7 @@ export const useTableColumns = (
349349 } ,
350350 ] ,
351351 [
352- navigate ,
352+ router ,
353353 uniqueErrors ,
354354 uniqueWarnings ,
355355 uniqueInfos ,
0 commit comments