@@ -2,7 +2,7 @@ import React from 'react';
22import { useGlobal } from 'reactn' ;
33import moment from 'moment' ;
44import { shallowEqual , useSelector } from 'react-redux' ;
5- import { IAudacityManagerStrings , MediaFile } from '../../model' ;
5+ import { IAudacityManagerStrings , IState , MediaFile } from '../../model' ;
66import {
77 Button ,
88 Dialog ,
@@ -22,6 +22,8 @@ import {
2222 useAudacityProjRead ,
2323 useAudacityProjDelete ,
2424 useAudProjName ,
25+ usePassageRec ,
26+ passageDescription ,
2527} from '../../crud' ;
2628import { useSnackBar } from '../../hoc/SnackBar' ;
2729import { debounce } from 'lodash' ;
@@ -74,6 +76,9 @@ function AudacityManager(props: IProps) {
7476 const { passageId, mediaId, onClose, open } = props ;
7577 const { item, onImport } = props ;
7678 const { speaker, onSpeaker } = props ;
79+ const allBookData = useSelector ( ( state : IState ) => state . books . bookData ) ;
80+ const getPassage = usePassageRec ( ) ;
81+ const [ passageRef , setPassageRef ] = React . useState ( '' ) ;
7782 const [ hasRights , setHasRight ] = React . useState ( ! onSpeaker ) ;
7883 const audUpdate = useAudacityProjUpdate ( ) ;
7984 const audRead = useAudacityProjRead ( ) ;
@@ -293,6 +298,10 @@ function AudacityManager(props: IProps) {
293298 nameUpdate ( ) ;
294299 }
295300 } ) ( ) ;
301+ if ( passageId ?. id ) {
302+ const passRec = getPassage ( passageId . id ) ;
303+ setPassageRef ( passageDescription ( passRec , allBookData ) ) ;
304+ }
296305 // eslint-disable-next-line react-hooks/exhaustive-deps
297306 } , [ passageId , name ] ) ;
298307
@@ -304,7 +313,7 @@ function AudacityManager(props: IProps) {
304313 maxWidth = "md"
305314 disableEnforceFocus
306315 >
307- < DialogTitle id = "manager-title" > { t . title } </ DialogTitle >
316+ < DialogTitle id = "manager-title" > { ` ${ t . title } - ${ passageRef } ` } </ DialogTitle >
308317 < StyledGrid container >
309318 { exists && name !== '' ? (
310319 < Grid container justifyContent = "center" >
0 commit comments