import PropTypes from 'prop-types'; import { useCallback } from 'react'; import { FormattedMessage } from 'react-intl'; import { useDispatch } from 'react-redux'; import AlternateEmailIcon from '@/material-icons/400-24px/alternate_email.svg?react'; import BlockIcon from '@/material-icons/400-24px/block.svg?react'; import CampaignIcon from '@/material-icons/400-24px/campaign.svg?react'; import ReplyIcon from '@/material-icons/400-24px/reply.svg?react'; import VisibilityOffIcon from '@/material-icons/400-24px/visibility_off.svg?react'; import { blockAccount } from 'mastodon/actions/accounts'; import { closeModal } from 'mastodon/actions/modal'; import { Button } from 'mastodon/components/button'; import { Icon } from 'mastodon/components/icon'; export const BlockModal = ({ accountId, acct }) => { const dispatch = useDispatch(); const handleClick = useCallback(() => { dispatch(closeModal({ modalType: undefined, ignoreFocus: false })); dispatch(blockAccount(accountId)); }, [dispatch, accountId]); const handleCancel = useCallback(() => { dispatch(closeModal({ modalType: undefined, ignoreFocus: false })); }, [dispatch]); return (

@{acct}
); }; BlockModal.propTypes = { accountId: PropTypes.string.isRequired, acct: PropTypes.string.isRequired, }; export default BlockModal;