snapshot of https://github.com/jitsi/jitsi-meet.git @ fd1749dd28f4138aa80234fc7f311b19aaffa0e7 (2026-09-15)
This commit is contained in:
28
react/features/audio-translation/hooks.web.ts
Normal file
28
react/features/audio-translation/hooks.web.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { useSelector } from 'react-redux';
|
||||
|
||||
import AudioTranslationButton from './components/web/AudioTranslationButton';
|
||||
import { isAudioTranslationAvailable } from './functions';
|
||||
|
||||
const audioTranslation = {
|
||||
key: 'audiotranslation',
|
||||
Content: AudioTranslationButton,
|
||||
group: 2
|
||||
};
|
||||
|
||||
/**
|
||||
* A hook that returns the audio-translation toolbar button when the feature is available to the local user,
|
||||
* and undefined otherwise. Audio translation requires the bridge translation backend (opt-in via
|
||||
* config.audioTranslation.enabled), is hidden when a moderator has disabled it for the room, and is always
|
||||
* shown to those who can manage it.
|
||||
*
|
||||
* @returns {Object | undefined}
|
||||
*/
|
||||
export function useAudioTranslationButton() {
|
||||
const available = useSelector(isAudioTranslationAvailable);
|
||||
|
||||
if (!available) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return audioTranslation;
|
||||
}
|
||||
Reference in New Issue
Block a user