File tree 1 file changed +14
-4
lines changed
src/components/WebexAudioSettings
1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import PropTypes from 'prop-types' ;
3
+ import { useMeetingControl } from '../hooks' ;
3
4
import webexComponentClasses from '../helpers' ;
4
5
import Title from '../generic/Title/Title' ;
5
6
import WebexMeetingControl from '../WebexMeetingControl/WebexMeetingControl' ;
7
+ import WebexNoMedia from '../WebexNoMedia/WebexNoMedia' ;
6
8
7
9
/**
8
10
* Webex Audio Settings component
@@ -15,13 +17,21 @@ import WebexMeetingControl from '../WebexMeetingControl/WebexMeetingControl';
15
17
*/
16
18
export default function WebexAudioSettings ( { className, meetingID, style} ) {
17
19
const cssClasses = webexComponentClasses ( 'audio-settings' , className ) ;
20
+ const [ , display ] = useMeetingControl ( 'switch-microphone' , meetingID ) ;
18
21
19
22
return (
20
23
< div className = { cssClasses } style = { style } >
21
- < Title > Speaker</ Title >
22
- < WebexMeetingControl type = "switch-speaker" meetingID = { meetingID } />
23
- < Title > Microphone</ Title >
24
- < WebexMeetingControl type = "switch-microphone" meetingID = { meetingID } />
24
+ { display . options ?. length !== 0
25
+ ? (
26
+ < >
27
+ < Title > Speaker</ Title >
28
+ < WebexMeetingControl type = "switch-speaker" meetingID = { meetingID } />
29
+ < Title > Microphone</ Title >
30
+ < WebexMeetingControl type = "switch-microphone" meetingID = { meetingID } />
31
+ </ >
32
+ ) : (
33
+ < WebexNoMedia media = "microphone" className = "no-media" />
34
+ ) }
25
35
</ div >
26
36
) ;
27
37
}
You can’t perform that action at this time.
0 commit comments