Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

DemoteToVisitorDialog.tsx 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import React, { useCallback } from 'react';
  2. import { useTranslation } from 'react-i18next';
  3. import { useDispatch } from 'react-redux';
  4. import { DialogProps } from '../../../base/dialog/constants';
  5. import Dialog from '../../../base/ui/components/web/Dialog';
  6. import { demoteRequest } from '../../../visitors/actions';
  7. interface IProps extends DialogProps {
  8. /**
  9. * The ID of the remote participant to be demoted.
  10. */
  11. participantID: string;
  12. }
  13. /**
  14. * Dialog to confirm a remote participant demote action.
  15. *
  16. * @returns {JSX.Element}
  17. */
  18. export default function DemoteToVisitorDialog({ participantID }: IProps): JSX.Element {
  19. const { t } = useTranslation();
  20. const dispatch = useDispatch();
  21. const handleSubmit = useCallback(() => {
  22. dispatch(demoteRequest(participantID));
  23. }, [ dispatch, participantID ]);
  24. return (
  25. <Dialog
  26. ok = {{ translationKey: 'dialog.confirm' }}
  27. onSubmit = { handleSubmit }
  28. titleKey = 'dialog.demoteParticipantTitle'>
  29. <div>
  30. { t('dialog.demoteParticipantDialog') }
  31. </div>
  32. </Dialog>
  33. );
  34. }