/** * @flow * @file Version component */ import * as React from 'react'; import { injectIntl, FormattedMessage } from 'react-intl'; import IconInfoInverted from '../../../../icons/general/IconInfoInverted'; import messages from '../../../common/messages'; import PlainButton from '../../../../components/plain-button'; import selectors from '../../../common/selectors/version'; import { ACTIVITY_TARGETS } from '../../../common/interactionTargets'; import { VERSION_UPLOAD_ACTION, VERSION_DELETE_ACTION, VERSION_RESTORE_ACTION } from '../../../../constants'; import './Version.scss'; type Props = { id: string, modified_by: User, onInfo?: Function, version_number: string, version_restored?: string, } & InjectIntlProvidedProps; const ACTION_MAP = { [VERSION_DELETE_ACTION]: messages.versionDeleted, [VERSION_RESTORE_ACTION]: messages.versionRestored, [VERSION_UPLOAD_ACTION]: messages.versionUploaded, }; const Version = (props: Props): React.Node => { const action = selectors.getVersionAction(props); const { id, intl, onInfo, version_number, version_restored } = props; const { name } = selectors.getVersionUser(props); return (