import PropTypes from 'prop-types'; import { useCallback, useState } from 'react'; import { FormattedMessage } from 'react-intl'; import classNames from 'classnames'; 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 [expanded, setExpanded] = useState(false); const domain = acct.split('@')[1]; const handleClick = useCallback(() => { dispatch(closeModal({ modalType: undefined, ignoreFocus: false })); dispatch(blockAccount(accountId)); }, [dispatch, accountId]); const handleCancel = useCallback(() => { dispatch(closeModal({ modalType: undefined, ignoreFocus: false })); }, [dispatch]); const handleToggleLearnMore = useCallback(() => { setExpanded(!expanded); }, [expanded, setExpanded]); return (