mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-18 15:27:47 +00:00
25 lines
562 B
TypeScript
25 lines
562 B
TypeScript
|
|
import { useSelector } from 'react-redux';
|
||
|
|
|
||
|
|
import { arePollsDisabled } from '../conference/functions.any';
|
||
|
|
|
||
|
|
import PollsButton from './components/web/PollsButton';
|
||
|
|
|
||
|
|
const polls = {
|
||
|
|
key: 'polls',
|
||
|
|
Content: PollsButton,
|
||
|
|
group: 2
|
||
|
|
};
|
||
|
|
|
||
|
|
/**
|
||
|
|
* A hook that returns the polls button if it is enabled and undefined otherwise.
|
||
|
|
*
|
||
|
|
* @returns {Object | undefined} - The polls button object or undefined.
|
||
|
|
*/
|
||
|
|
export function usePollsButton() {
|
||
|
|
const isPollsDisabled = useSelector(arePollsDisabled);
|
||
|
|
|
||
|
|
if (!isPollsDisabled) {
|
||
|
|
return polls;
|
||
|
|
}
|
||
|
|
}
|