import React from 'react'; import { FormattedMessage } from 'react-intl'; import MissingIndicator from 'soapbox/components/missing_indicator'; import { Button, HStack, Modal } from 'soapbox/components/ui'; import { useAppSelector, useFeatures } from 'soapbox/hooks'; import { makeGetAccount } from 'soapbox/selectors'; const getAccount = makeGetAccount(); interface IAccountModerationModal { /** Action to close the modal. */ onClose: (type: string) => void, /** ID of the account to moderate. */ accountId: string, } /** Moderator actions against accounts. */ const AccountModerationModal: React.FC = ({ onClose, accountId }) => { const features = useFeatures(); const account = useAppSelector(state => getAccount(state, accountId)); const handleClose = () => onClose('ACCOUNT_MODERATION'); if (!account) { return ( ); } const handleAdminFE = () => { window.open(`/pleroma/admin/#/users/${account.id}/`, '_blank'); }; return ( } onClose={handleClose} > {features.adminFE && ( )} ); }; export default AccountModerationModal;