import type { FC } from 'react' import { memo, useRef, } from 'react' import { useHover } from 'ahooks' import type { ConversationItem } from '@/models/share' import { MessageDotsCircle } from '@/app/components/base/icons/src/vender/solid/communication' import ItemOperation from '@/app/components/explore/item-operation' type ItemProps = { isPin?: boolean item: ConversationItem onOperate: (type: string, item: ConversationItem) => void onChangeConversation: (conversationId: string) => void currentConversationId: string } const Item: FC = ({ isPin, item, onOperate, onChangeConversation, currentConversationId, }) => { const ref = useRef(null) const isHovering = useHover(ref) return (
onChangeConversation(item.id)} >
{item.name}
{item.id !== '' && (
e.stopPropagation()}> onOperate(isPin ? 'unpin' : 'pin', item)} isShowDelete isShowRenameConversation onRenameConversation={() => onOperate('rename', item)} onDelete={() => onOperate('delete', item)} />
)}
) } export default memo(Item)