@@ -4,8 +4,7 @@ import Layout from "../../components/global/layout"
44import SEO from "../../components/global/seo"
55import { navigate } from "gatsby"
66import React from "react"
7- import { useQueryParamString } from 'react-use-query-param-string' ;
8- // import { StringParam,NumberParam, useQueryParam } from "use-query-params"
7+ import { getQueryParams } from "react-use-query-param-string" ;
98import TestRunDetail from "../../components/testrun/testrun-detail"
109import { ThemeProvider } from "@mui/material/styles"
1110import { theme } from "../../services/services"
@@ -15,9 +14,10 @@ export default function Detail() {
1514 return null
1615 }
1716
18- const [ id ] = useQueryParamString ( "id" , '' )
19- const [ index = '0' ] = useQueryParamString ( "index" , '0' )
20- const [ tdId = "" ] = useQueryParamString ( "tdId" , '' )
17+ const params = getQueryParams ( ) ;
18+ const id = params [ 'id' ] ? params [ 'id' ] . toString ( ) : ""
19+ const index = params [ 'index' ] ? params [ 'index' ] : '0'
20+ const tdId = params [ 'tdId' ] ? params [ 'tdId' ] . toString ( ) : ""
2121
2222 if ( id == null ) {
2323 typeof window !== `undefined` && navigate ( "/testruns" )
@@ -27,7 +27,7 @@ export default function Detail() {
2727 < ThemeProvider theme = { theme } >
2828 < Layout >
2929 < SEO title = "Testrun Details" />
30- < TestRunDetail testRunID = { id ! } index = { index . toString ( ) } tdId = { tdId } />
30+ < TestRunDetail testRunID = { id ! } index = { Number ( index ) } tdId = { tdId } />
3131 </ Layout >
3232 </ ThemeProvider >
3333 </ ApolloProvider >
0 commit comments