import React from 'react'; import { View } from 'react-native'; import PropTypes from 'prop-types'; import Avatar from '../../containers/Avatar'; import { DisplayMode } from '../../lib/constants'; import TypeIcon from './TypeIcon'; import styles from './styles'; const IconOrAvatar = ({ avatar, type, rid, showAvatar, prid, status, isGroupChat, teamMain, showLastMessage, theme, displayMode, sourceType }) => { if (showAvatar) { return ( ); } if (displayMode === DisplayMode.Expanded && showLastMessage) { return ( ); } return null; }; IconOrAvatar.propTypes = { avatar: PropTypes.string, type: PropTypes.string, theme: PropTypes.string, rid: PropTypes.string, showAvatar: PropTypes.bool, displayMode: PropTypes.string, prid: PropTypes.string, status: PropTypes.string, isGroupChat: PropTypes.bool, teamMain: PropTypes.bool, showLastMessage: PropTypes.bool }; export default IconOrAvatar;