jitsi-meet/react/features/video-menu/components/web/DemoteToVisitorDialog.tsx
theluyuan 38ba663466
Some checks failed
Close stale issues and PRs / stale (push) Has been cancelled
init
2025-09-02 14:49:16 +08:00

41 lines
1.1 KiB
TypeScript

import React, { useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { useDispatch } from 'react-redux';
import { DialogProps } from '../../../base/dialog/constants';
import Dialog from '../../../base/ui/components/web/Dialog';
import { demoteRequest } from '../../../visitors/actions';
interface IProps extends DialogProps {
/**
* The ID of the remote participant to be demoted.
*/
participantID: string;
}
/**
* Dialog to confirm a remote participant demote action.
*
* @returns {JSX.Element}
*/
export default function DemoteToVisitorDialog({ participantID }: IProps): JSX.Element {
const { t } = useTranslation();
const dispatch = useDispatch();
const handleSubmit = useCallback(() => {
dispatch(demoteRequest(participantID));
}, [ dispatch, participantID ]);
return (
<Dialog
ok = {{ translationKey: 'dialog.confirm' }}
onSubmit = { handleSubmit }
titleKey = 'dialog.demoteParticipantTitle'>
<div>
{ t('dialog.demoteParticipantDialog') }
</div>
</Dialog>
);
}