import PropTypes from 'prop-types'; import { useCallback } from 'react'; import { FormattedMessage } from 'react-intl'; import { useDispatch } from 'react-redux'; import CampaignIcon from '@/material-icons/400-24px/campaign.svg?react'; import DomainDisabledIcon from '@/material-icons/400-24px/domain_disabled.svg?react'; import HistoryIcon from '@/material-icons/400-24px/history.svg?react'; import PersonRemoveIcon from '@/material-icons/400-24px/person_remove.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 { blockDomain } from 'mastodon/actions/domain_blocks'; import { closeModal } from 'mastodon/actions/modal'; import { Button } from 'mastodon/components/button'; import { Icon } from 'mastodon/components/icon'; export const DomainBlockModal = ({ domain, accountId, acct }) => { const dispatch = useDispatch(); const handleClick = useCallback(() => { dispatch(closeModal({ modalType: undefined, ignoreFocus: false })); dispatch(blockDomain(domain)); }, [dispatch, domain]); const handleSecondaryClick = useCallback(() => { dispatch(closeModal({ modalType: undefined, ignoreFocus: false })); dispatch(blockAccount(accountId)); }, [dispatch, accountId]); const handleCancel = useCallback(() => { dispatch(closeModal({ modalType: undefined, ignoreFocus: false })); }, [dispatch]); return (