import PropTypes from 'prop-types'; import { useCallback } from 'react'; import { defineMessages, useIntl } from 'react-intl'; import { Link } from 'react-router-dom'; import { useSelector, useDispatch } from 'react-redux'; import DoneIcon from '@/material-icons/400-24px/done.svg?react'; import VolumeOffIcon from '@/material-icons/400-24px/volume_off.svg?react'; import { acceptNotificationRequest, dismissNotificationRequest } from 'mastodon/actions/notifications'; import { Avatar } from 'mastodon/components/avatar'; import { IconButton } from 'mastodon/components/icon_button'; import { makeGetAccount } from 'mastodon/selectors'; import { toCappedNumber } from 'mastodon/utils/numbers'; const getAccount = makeGetAccount(); const messages = defineMessages({ accept: { id: 'notification_requests.accept', defaultMessage: 'Accept' }, dismiss: { id: 'notification_requests.dismiss', defaultMessage: 'Dismiss' }, }); export const NotificationRequest = ({ id, accountId, notificationsCount }) => { const dispatch = useDispatch(); const account = useSelector(state => getAccount(state, accountId)); const intl = useIntl(); const handleDismiss = useCallback(() => { dispatch(dismissNotificationRequest(id)); }, [dispatch, id]); const handleAccept = useCallback(() => { dispatch(acceptNotificationRequest(id)); }, [dispatch, id]); return (