forked from element-hq/element-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRoomListItemContextMenu.tsx
More file actions
40 lines (36 loc) · 1.18 KB
/
RoomListItemContextMenu.tsx
File metadata and controls
40 lines (36 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* Copyright 2026 Element Creations Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
import React, { type JSX, type PropsWithChildren } from "react";
import { ContextMenu } from "@vector-im/compound-web";
import { _t } from "../../../../core/i18n/i18n";
import { MoreOptionContent, type RoomListItemViewModel } from "./RoomListItemMoreOptionsMenu";
/**
* Props for RoomListItemContextMenu component
*/
export interface RoomListItemContextMenuProps {
/** The room item view model */
vm: RoomListItemViewModel;
}
/**
* The context menu for room list items.
* Wraps the trigger element with a right-click context menu displaying room options.
*/
export const RoomListItemContextMenu: React.FC<PropsWithChildren<RoomListItemContextMenuProps>> = ({
vm,
children,
}): JSX.Element => {
return (
<ContextMenu
title={_t("room_list|room|more_options")}
showTitle={false}
hasAccessibleAlternative={true}
trigger={children}
>
<MoreOptionContent vm={vm} />
</ContextMenu>
);
};