Files
jitsi-meet/react/features/notifications/components/web/NotificationButton.js
Дамян Минков 64ae9c7953 feat: UI part for A/V moderation. (#9195)
* feat: Initial UI part for A/V moderation.

Based on https://github.com/jitsi/jitsi-meet/pull/7779

Co-authored-by: Gabriel Imre <gabriel.lucaci@8x8.com>

* feat: Hides context menu in p2p or only moderators in the meeting.

* feat: Show notifications on enable/disable.

* feat(moderation): Add buttons to participant list & notifications

* fix(moderation): Fix raised hand participant leaving

* feat(moderation): Add support for video moderation

* feat(moderation): Add mute all video to context menu

* feat(moderation): Redo participants list 'More menu'

* fix: Fixes clearing av_moderation table.

* fix: Start moderation context menu

* fix(moderation): Show notification if unapproved participant tries to start CS

Co-authored-by: Gabriel Imre <gabriel.lucaci@8x8.com>
Co-authored-by: Vlad Piersec <vlad.piersec@8x8.com>
2021-06-23 14:23:44 +03:00

53 lines
1.0 KiB
JavaScript

// @flow
import React, { useCallback } from 'react';
import { useDispatch } from 'react-redux';
type Props = {
/**
* Action to be dispatched on click.
*/
action: Function,
/**
* The text of the button.
*/
children: React$Node,
/**
* CSS class of the button.
*/
className: string,
/**
* The `data-testid` used for the button.
*/
testId: string,
/**
* The participant.
*/
participant: Object
}
/**
* Component used to display an approve/reject button.
*
* @returns {React$Element<'button'>}
*/
export default function({ action, children, className, testId, participant }: Props) {
const dispatch = useDispatch();
const onClick = useCallback(() => dispatch(action(participant.id)), [ dispatch, participant ]);
return (
<button
className = { className }
data-testid = { testId }
onClick = { onClick }
type = 'button'>
{ children }
</button>
);
}