mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-04-02 17:00:19 +00:00
* feat(av-moderation) raised hand ask to unmute aria-label * feat(av-moderation) fixed test * feat(av-moderation) added id for notification buttons * feat(av-moderation) fixed lint error * feat(av-moderation) added id for non raised hand participant * feat(av-moderation) added extra id naming for ask to unmute button and participant items * feat(av-moderation) fixed lint errors * feat(av-moderation) changed id to participantID * feat(av-moderation) removed semicolon * squash: Drop unused id for participantItem. * squash: Drop unused fields for raisedHand. Co-authored-by: Дамян Минков <damencho@jitsi.org>
59 lines
1.1 KiB
JavaScript
59 lines
1.1 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,
|
|
|
|
/**
|
|
* CSS id of the button.
|
|
*/
|
|
id?: string,
|
|
|
|
/**
|
|
* The participant.
|
|
*/
|
|
participant: Object,
|
|
|
|
/**
|
|
* The `data-testid` used for the button.
|
|
*/
|
|
testId: string
|
|
}
|
|
|
|
/**
|
|
* Component used to display an approve/reject button.
|
|
*
|
|
* @returns {React$Element<'button'>}
|
|
*/
|
|
export default function({ action, children, className, participant, id, testId }: Props) {
|
|
const dispatch = useDispatch();
|
|
const onClick = useCallback(() => dispatch(action(participant.id)), [ dispatch, participant ]);
|
|
|
|
return (
|
|
<button
|
|
className = { className }
|
|
data-testid = { testId }
|
|
id = { id }
|
|
onClick = { onClick }
|
|
type = 'button'>
|
|
{ children }
|
|
</button>
|
|
);
|
|
}
|