File tree Expand file tree Collapse file tree
apps/web/src/components/views/rooms Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2026 Element Creations Ltd.
3+ *
4+ * SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
5+ * Please see LICENSE files in the repository root for full details.
6+ */
7+
8+ import { StartChatView , useCreateAutoDisposedViewModel } from "@element-hq/web-shared-components" ;
9+ import React , { type JSX } from "react" ;
10+
11+ import { StartChatViewModel } from "../../../viewmodels/room/StartChatViewModel" ;
12+ import { useMatrixClientContext } from "../../../contexts/MatrixClientContext" ;
13+ import { useScopedRoomContext } from "../../../contexts/ScopedRoomContext" ;
14+
15+ /**
16+ * Wrapper around StartChatView that creates the StartChatViewModel and passes it to the view.
17+ */
18+ export function StartChat ( ) : JSX . Element {
19+ const matrixClient = useMatrixClientContext ( ) ;
20+ const { room } = useScopedRoomContext ( "room" , "roomId" ) ;
21+ const vm = useCreateAutoDisposedViewModel ( ( ) => new StartChatViewModel ( { room : room ! , matrixClient } ) ) ;
22+
23+ return < StartChatView vm = { vm } /> ;
24+ }
You can’t perform that action at this time.
0 commit comments