import React from 'react'; import classNames from 'classnames'; import { ContextMenu, ContextMenuTrigger, MenuItem, SubMenu, } from 'react-contextmenu'; import { Emojify } from './Emojify'; import { Avatar } from '../Avatar'; import { InContactsIcon } from '../InContactsIcon'; import { LocalizerType } from '../../types/Util'; import { ColorType } from '../../types/Colors'; import { getMuteOptions } from '../../util/getMuteOptions'; interface TimerOption { name: string; value: number; } export interface PropsDataType { id: string; name?: string; phoneNumber?: string; profileName?: string; color?: ColorType; avatarPath?: string; type: 'direct' | 'group'; title: string; isAccepted?: boolean; isVerified?: boolean; isMe?: boolean; isArchived?: boolean; disableTimerChanges?: boolean; expirationSettingName?: string; muteExpirationLabel?: string; showBackButton?: boolean; timerOptions?: Array; } export interface PropsActionsType { onSetMuteNotifications: (seconds: number) => void; onSetDisappearingMessages: (seconds: number) => void; onDeleteMessages: () => void; onResetSession: () => void; onSearchInConversation: () => void; onOutgoingAudioCallInConversation: () => void; onOutgoingVideoCallInConversation: () => void; onShowSafetyNumber: () => void; onShowAllMedia: () => void; onShowGroupMembers: () => void; onGoBack: () => void; onArchive: () => void; onMoveToInbox: () => void; } export interface PropsHousekeepingType { i18n: LocalizerType; } export type PropsType = PropsDataType & PropsActionsType & PropsHousekeepingType; export class ConversationHeader extends React.Component { public showMenuBound: (event: React.MouseEvent) => void; // Comes from a third-party dependency // eslint-disable-next-line @typescript-eslint/no-explicit-any public menuTriggerRef: React.RefObject; public constructor(props: PropsType) { super(props); this.menuTriggerRef = React.createRef(); this.showMenuBound = this.showMenu.bind(this); } public showMenu(event: React.MouseEvent): void { if (this.menuTriggerRef.current) { this.menuTriggerRef.current.handleContextClick(event); } } public renderBackButton(): JSX.Element { const { i18n, onGoBack, showBackButton } = this.props; return (