import React, { useContext } from 'react'; import { Text, View } from 'react-native'; import Touchable from './Touchable'; import { CustomIcon } from '../../lib/Icons'; import styles from './styles'; import { BUTTON_HIT_SLOP } from './utils'; import I18n from '../../i18n'; import { themes } from '../../lib/constants'; import MessageContext from './Context'; import { IMessageBroadcast } from './interfaces'; import { useTheme } from '../../theme'; const Broadcast = React.memo(({ author, broadcast }: IMessageBroadcast) => { const { user, replyBroadcast } = useContext(MessageContext); const { theme } = useTheme(); const isOwn = author?._id === user.id; if (broadcast && !isOwn) { return ( <> {I18n.t('Reply')} ); } return null; }); Broadcast.displayName = 'MessageBroadcast'; export default Broadcast;