Skip to content

Commit 4a4652b

Browse files
lungancatalinlalli-flores
authored andcommitted
feat(WebexAudioSettings): displays the error when no microphone is available
1 parent d1d36ef commit 4a4652b

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/components/WebexAudioSettings/WebexAudioSettings.jsx

+14-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
3+
import {useMeetingControl} from '../hooks';
34
import webexComponentClasses from '../helpers';
45
import Title from '../generic/Title/Title';
56
import WebexMeetingControl from '../WebexMeetingControl/WebexMeetingControl';
7+
import WebexNoMedia from '../WebexNoMedia/WebexNoMedia';
68

79
/**
810
* Webex Audio Settings component
@@ -15,13 +17,21 @@ import WebexMeetingControl from '../WebexMeetingControl/WebexMeetingControl';
1517
*/
1618
export default function WebexAudioSettings({className, meetingID, style}) {
1719
const cssClasses = webexComponentClasses('audio-settings', className);
20+
const [, display] = useMeetingControl('switch-microphone', meetingID);
1821

1922
return (
2023
<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+
)}
2535
</div>
2636
);
2737
}

0 commit comments

Comments
 (0)