import React from 'react'; import { HMSPeerID, selectLocalPeerID, selectPermissions, useHMSActions, useHMSStore } from '@100mslive/react-sdk'; import { PeopleRemoveIcon } from '@100mslive/react-icons'; // @ts-ignore: No implicit Any import { ToastManager } from './Toast/ToastManager'; import { Dropdown } from '../../Dropdown'; import { Text } from '../../Text'; export const RemoveParticipant = ({ peerId }: { peerId: HMSPeerID }) => { const canRemoveOthers = useHMSStore(selectPermissions)?.removeOthers; const localPeerId = useHMSStore(selectLocalPeerID); const actions = useHMSActions(); if (peerId === localPeerId || !canRemoveOthers) { return null; } return ( { try { await actions.removePeer(peerId, ''); } catch (error) { const ex = error as Error; ToastManager.addToast({ title: ex.message, variant: 'error' }); } }} > Remove Participant ); };