import React from 'react'; import { connect } from 'react-redux'; import { FormattedMessage } from 'react-intl'; import ImmutablePureComponent from 'react-immutable-pure-component'; import StatusContent from 'soapbox/components/status_content'; import { buildStatus } from '../util/pending_status_builder'; import classNames from 'classnames'; import RelativeTimestamp from 'soapbox/components/relative_timestamp'; import { Link, NavLink } from 'react-router-dom'; import { getDomain } from 'soapbox/utils/accounts'; import Avatar from 'soapbox/components/avatar'; import DisplayName from 'soapbox/components/display_name'; import AttachmentThumbs from 'soapbox/components/attachment_thumbs'; import PollPreview from './poll_preview'; const mapStateToProps = (state, props) => { const { idempotencyKey } = props; const pendingStatus = state.getIn(['pending_statuses', idempotencyKey]); return { status: pendingStatus ? buildStatus(state, pendingStatus, idempotencyKey) : null, }; }; export default @connect(mapStateToProps) class PendingStatus extends ImmutablePureComponent { render() { const { status, className, showThread } = this.props; if (!status) return null; if (!status.get('account')) return null; const favicon = status.getIn(['account', 'pleroma', 'favicon']); const domain = getDomain(status.get('account')); return (
{favicon &&
}
{status.get('poll') && } {showThread && status.get('in_reply_to_id') && status.get('in_reply_to_account_id') === status.getIn(['account', 'id']) && ( )} {/* TODO */} {/* */}
); } }