Files
upstream-jitsi-meet/react/features/audio-translation/hooks.web.ts
upstream-mirror 1d2bfcac0c
Some checks failed
Prosody Plugin Tests / test (push) Failing after 10m11s
Close stale issues and PRs / stale (push) Failing after 1s
snapshot of https://github.com/jitsi/jitsi-meet.git @ fd1749dd28f4138aa80234fc7f311b19aaffa0e7 (2026-09-15)
2026-09-15 15:56:32 +05:00

29 lines
885 B
TypeScript

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;
}