import React, { useState } from 'react';
import { animation, Menu } from 'react-contexify';
import { ConversationTypeEnum } from '../../../models/conversation';
import { ConversationListItemType } from '../../ConversationListItem';
import {
getBlockMenuItem,
getChangeNicknameMenuItem,
getClearNicknameMenuItem,
getCopyMenuItem,
getDeleteContactMenuItem,
getDeleteMessagesMenuItem,
getInviteContactMenuItem,
getLeaveGroupMenuItem,
getMarkAllReadMenuItem,
MenuItemPinConversation
} from './Menu';
export type PropsContextConversationItem = {
id: string;
triggerId: string;
type: ConversationTypeEnum;
conversationListItemType: ConversationListItemType;
isMe: boolean;
isPublic?: boolean;
isBlocked?: boolean;
hasNickname?: boolean;
isKickedFromGroup?: boolean;
left?: boolean;
theme?: any;
};
export const ConversationListItemContextMenu = (props: PropsContextConversationItem) => {
const {
id: conversationId,
triggerId,
isBlocked,
isMe,
isPublic,
hasNickname,
type,
left,
isKickedFromGroup,
conversationListItemType,
} = props;
const isGroup = type === 'group';
const isConversation = conversationListItemType === ConversationListItemType.Conversation;
const pinMenuItem = isConversation ?