import type React from 'react'; import { useState, useCallback } from 'react'; import { useUIKit, IconAdd } from '@tencentcloud/uikit-base-component-react'; import classNames from 'classnames'; import { ContactItemType } from '../../../types/contact'; import { ExactSearchH5 } from '../../SearchNewH5'; import styles from './ContactSearch.module.scss'; import type { ContactSearchProps } from '../../../types/contact'; import type { ExactSearchH5Result } from '../../SearchNewH5'; export const ContactSearch: React.FC = ({ className, style, onResultClick, onKeywordChange, }) => { const { t } = useUIKit(); const [isShowSearch, setIsShowSearch] = useState(false); const handleResultItemClick = useCallback((result: ExactSearchH5Result) => { onResultClick?.({ type: result.type === 'user' ? ContactItemType.SEARCH_USER : ContactItemType.SEARCH_GROUP, data: result.data as any, }); }, [onResultClick]); const handleCancel = () => { setIsShowSearch(false); onKeywordChange?.(''); }; return (
{!isShowSearch ? (
setIsShowSearch(true)}> {t('ContactList.add_friend_group')}
) : ( )}
); }; export default ContactSearch;