import React, { useContext } from 'react'; import { ActivityIndicator, Text, TouchableOpacity, View } from 'react-native'; import { themes } from '../../../lib/constants'; import I18n from '../../../i18n'; import { CustomIcon } from '../../CustomIcon'; import { useTheme } from '../../../theme'; import sharedStyles from '../../../views/Styles'; import MessageboxContext from '../Context'; import styles from '../styles'; import { MENTIONS_TRACKING_TYPE_CANNED } from '../constants'; interface IMentionHeaderList { trackingType: string; hasMentions: boolean; loading: boolean; } const MentionHeaderList = ({ trackingType, hasMentions, loading }: IMentionHeaderList) => { const { theme } = useTheme(); 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; }; export default MentionHeaderList;