import React, { useContext } from 'react'; import { View, Text, ActivityIndicator, TouchableOpacity } from 'react-native'; import PropTypes from 'prop-types'; import { MENTIONS_TRACKING_TYPE_CANNED } from '../constants'; import styles from '../styles'; import sharedStyles from '../../../views/Styles'; import I18n from '../../../i18n'; import { themes } from '../../../constants/colors'; import { CustomIcon } from '../../../lib/Icons'; import MessageboxContext from '../Context'; const MentionHeaderList = ({ trackingType, hasMentions, theme, loading }) => { const context = useContext(MessageboxContext); const { onPressNoMatchCanned } = context; if (trackingType === MENTIONS_TRACKING_TYPE_CANNED) { if (loading) { return ( {I18n.t('Searching')} ); } if (!hasMentions) { return ( {I18n.t('No_match_found')} {I18n.t('Check_canned_responses')} ); } } return null; }; MentionHeaderList.propTypes = { trackingType: PropTypes.string, hasMentions: PropTypes.bool, theme: PropTypes.string, loading: PropTypes.bool }; export default MentionHeaderList;