@@ -7,7 +7,7 @@ import { InstrumentRenderer, type InstrumentSubmitHandler } from '@opendatacaptu
77import type { UnilingualInstrumentInfo } from '@opendatacapture/schemas/instrument' ;
88import type { CreateInstrumentRecordData } from '@opendatacapture/schemas/instrument-records' ;
99import axios from 'axios' ;
10- import { useLocation , useNavigate , useParams } from 'react-router-dom' ;
10+ import { type Location , useLocation , useNavigate , useParams } from 'react-router-dom' ;
1111
1212import { PageHeader } from '@/components/PageHeader' ;
1313import { useInstrumentBundle } from '@/hooks/useInstrumentBundle' ;
@@ -20,13 +20,12 @@ export const InstrumentRenderPage = () => {
2020 const params = useParams ( ) ;
2121 const navigate = useNavigate ( ) ;
2222 const notifications = useNotificationsStore ( ) ;
23- const location = useLocation ( ) ;
23+ const location = useLocation ( ) as Location < { info ?: UnilingualInstrumentInfo } > ;
2424 const { t } = useTranslation ( ) ;
2525
2626 const instrumentBundleQuery = useInstrumentBundle ( params . id ! ) ;
2727
28- const locationState = location . state as { instrument ?: undefined | UnilingualInstrumentInfo } | undefined ;
29- const title = locationState ?. instrument ?. details . title ;
28+ const title = location . state ?. info ?. clientDetails ?. title ?? location . state . info ?. details . title ;
3029
3130 useEffect ( ( ) => {
3231 if ( ! currentSession ?. id ) {
0 commit comments