import { useEffect, useRef } from 'react'; import { useMeetingStore } from '../../data/meeting-store'; import { useCall, useCallSelector } from 'callskit/react'; import { DismissRegular } from '@fluentui/react-icons'; export function Settings({ audioRef, }: { audioRef: React.RefObject; }) { const call = useCall(); const self = useCallSelector((c) => c.self); const dialogRef = useRef(null); const store = useMeetingStore(); useEffect(() => { if (store.settingsOpen) { dialogRef.current?.showModal(); } else { dialogRef.current?.close(); } }, [store.settingsOpen]); const mics = self.devices?.filter((device) => device.kind === 'audioinput'); const cameras = self.devices?.filter( (device) => device.kind === 'videoinput', ); const speakers = self.devices?.filter( (device) => device.kind === 'audiooutput', ); const isSetSinkIdSupported = 'setSinkId' in HTMLAudioElement.prototype; const activeDevices = call.self.activeDevices; return ( { store.setSettingsOpen(false); }} >

Device Settings

{isSetSinkIdSupported && (
)}
); }