import React from 'react'; import PropTypes from 'prop-types'; import { Link } from 'react-router-dom'; import moment from 'moment'; import { UserType, MessageType } from './Types'; import Icon from './Icon'; import Avatar from './Avatar'; import { format } from '../utils/embed'; const Message = React.memo(({ data, visitor, children, ...rest }) => { return (

= 0) }}>

{data.photo &&

} {children}
); }); export default Message; const Tags = React.memo(({ data, user, ...rest }) => { return data.length > 0 && (
{ data.map(tag => { return ({tag}); }) }
); }); Message.propTypes = { data: MessageType, visitor: UserType.isRequired, children: PropTypes.node }; Tags.propTypes = { user: UserType.isRequired, data: PropTypes.array };