import { useCallback } from 'react'; import { defineMessages, useIntl, FormattedMessage } from 'react-intl'; import { Link } from 'react-router-dom'; import { useDispatch, useSelector } from 'react-redux'; import BarChart4BarsIcon from '@/material-icons/400-24px/bar_chart_4_bars.svg?react'; import CloseIcon from '@/material-icons/400-24px/close.svg?react'; import PhotoLibraryIcon from '@/material-icons/400-24px/photo_library.svg?react'; import { cancelReplyCompose } from 'mastodon/actions/compose'; import { Icon } from 'mastodon/components/icon'; import { IconButton } from 'mastodon/components/icon_button'; import { RelativeTimestamp } from 'mastodon/components/relative_timestamp'; const messages = defineMessages({ cancel: { id: 'reply_indicator.cancel', defaultMessage: 'Cancel' }, }); export const EditIndicator = () => { const intl = useIntl(); const dispatch = useDispatch(); const id = useSelector(state => state.getIn(['compose', 'id'])); const status = useSelector(state => state.getIn(['statuses', id])); const account = useSelector(state => state.getIn(['accounts', status?.get('account')])); const handleCancelClick = useCallback(() => { dispatch(cancelReplyCompose()); }, [dispatch]); if (!status) { return null; } const content = { __html: status.get('contentHtml') }; return (
@{account.get('acct')} ยท
{(status.get('poll') || status.get('media_attachments').size > 0) && (
{status.get('poll') && <>} {status.get('media_attachments').size > 0 && <>}
)}
); };