Files
jitsi-meet/react/features/notifications/components/web/NotificationButton.js
Calinteodor e40d4a48b8 feat(av-moderation) id and aria-label updates for av-moderation test (#9592)
* 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>
2021-08-15 00:27:18 -05:00

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