import PropTypes from 'prop-types'; import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import AttachmentThumbs from 'soapbox/components/attachment_thumbs'; import { Stack, Text } from 'soapbox/components/ui'; import AccountContainer from 'soapbox/containers/account_container'; import { isRtl } from '../../../rtl'; export default class ReplyIndicator extends ImmutablePureComponent { static contextTypes = { router: PropTypes.object, }; static propTypes = { status: ImmutablePropTypes.map, onCancel: PropTypes.func.isRequired, hideActions: PropTypes.bool, }; handleClick = () => { this.props.onCancel(); } render() { const { status, hideActions } = this.props; if (!status) { return null; } const style = { direction: isRtl(status.get('search_index')) ? 'rtl' : 'ltr', }; let actions = {}; if (!hideActions) { actions = { onActionClick: this.handleClick, actionIcon: require('@tabler/icons/icons/x.svg'), actionAlignment: 'top', actionTitle: 'Dismiss', }; } return ( {status.get('media_attachments').size > 0 && ( )} ); } }