import React from 'react'; import { Text } from 'react-native'; import PropTypes from 'prop-types'; import I18n from '../../i18n'; import styles from './styles'; import Markdown from './Markdown'; import { getInfoMessage } from './utils'; const Content = React.memo((props) => { if (props.isInfo) { return {getInfoMessage({ ...props })}; } if (props.tmid && !props.msg) { return {I18n.t('Sent_an_attachment')}; } return ( ); }, (prevProps, nextProps) => prevProps.msg === nextProps.msg); Content.propTypes = { isInfo: PropTypes.bool, isEdited: PropTypes.bool, useMarkdown: PropTypes.bool, tmid: PropTypes.string, msg: PropTypes.string, baseUrl: PropTypes.string, user: PropTypes.object, mentions: PropTypes.oneOfType([PropTypes.array, PropTypes.object]), channels: PropTypes.oneOfType([PropTypes.array, PropTypes.object]), getCustomEmoji: PropTypes.func }; Content.displayName = 'MessageContent'; export default Content;