import classNames from 'clsx'; import React, { useRef } from 'react'; import { FormattedDate, FormattedMessage, useIntl } from 'react-intl'; import Icon from 'soapbox/components/icon'; import StatusMedia from 'soapbox/components/status-media'; import StatusReplyMentions from 'soapbox/components/status-reply-mentions'; import StatusContent from 'soapbox/components/status_content'; import ModerationOverlay from 'soapbox/components/statuses/moderation-overlay'; import { HStack, Stack, Text } from 'soapbox/components/ui'; import AccountContainer from 'soapbox/containers/account_container'; import QuotedStatus from 'soapbox/features/status/containers/quoted_status_container'; import { getActualStatus } from 'soapbox/utils/status'; import StatusInteractionBar from './status-interaction-bar'; import type { List as ImmutableList } from 'immutable'; import type { Attachment as AttachmentEntity, Status as StatusEntity } from 'soapbox/types/entities'; interface IDetailedStatus { status: StatusEntity, onOpenMedia: (media: ImmutableList, index: number) => void, onOpenVideo: (media: ImmutableList, start: number) => void, onToggleHidden: (status: StatusEntity) => void, showMedia: boolean, onOpenCompareHistoryModal: (status: StatusEntity) => void, onToggleMediaVisibility: () => void, } const DetailedStatus: React.FC = ({ status, onToggleHidden, onOpenCompareHistoryModal, onToggleMediaVisibility, showMedia, }) => { const intl = useIntl(); const node = useRef(null); const handleExpandedToggle = () => { onToggleHidden(status); }; const handleOpenCompareHistoryModal = () => { onOpenCompareHistoryModal(status); }; const actualStatus = getActualStatus(status); if (!actualStatus) return null; const { account } = actualStatus; if (!account || typeof account !== 'object') return null; const inReview = actualStatus.visibility === 'self'; const isSensitive = actualStatus.sensitive; let statusTypeIcon = null; let quote; if (actualStatus.quote) { if (actualStatus.pleroma.get('quote_visible', true) === false) { quote = (

); } else { quote = ; } } if (actualStatus.visibility === 'direct') { statusTypeIcon = ; } else if (actualStatus.visibility === 'private') { statusTypeIcon = ; } return (
{(inReview || isSensitive) ? ( ) : null} {quote} {statusTypeIcon} {actualStatus.edited_at && ( <> {' ยท '}
)}
); }; export default DetailedStatus;