import type React from 'react'; import { useUIKit, Button } from '@tencentcloud/uikit-base-component-react'; import classNames from 'classnames'; import { ContactStore } from 'tuikit-atomicx-react/chat'; import { ContactItemType } from '../../../../types/contact'; import { Avatar } from 'tuikit-atomicx-react/chat'; import { useContactList } from '../../hooks/useContactList'; import styles from './BlacklistInfo.module.scss'; import type { BlacklistInfoProps } from '../../../../types/contact'; export const BlacklistInfo: React.FC = ({ profile, showActions = true, onRemoveFromBlacklist, onClose, className, style, }) => { const { t } = useUIKit(); const { friendList, removeFromBlacklist } = ContactStore(); const { setActiveContact } = useContactList(); const handleRemoveFromBlacklist = async () => { await removeFromBlacklist(profile.userID); const friend = friendList.find(item => item.userID === profile.userID); if (friend) { setActiveContact({ type: ContactItemType.FRIEND, data: friend, }); } else { setActiveContact(undefined); onClose?.(); } onRemoveFromBlacklist?.(profile); }; return (
{profile.nickname || profile.userID}
{t('ContactList.id')} : {profile.userID}
{t('ContactList.personal_signature')}
{profile.aboutMe || t('ContactList.none')}
{showActions && (
)}
); };