2024-07-20 14:16:26 +02:00
|
|
|
import "./chatPage.css";
|
|
|
|
|
|
|
|
|
|
import * as React from "bloatless-react";
|
|
|
|
|
|
2024-07-22 21:07:44 +02:00
|
|
|
import ChatListViewModel from "../ViewModel/Chat/chatListViewModel";
|
2024-07-20 14:16:26 +02:00
|
|
|
import { ChatPage } from "./chatPage";
|
2026-04-09 16:48:22 +00:00
|
|
|
import CoreViewModel from "../ViewModel/Global/coreViewModel";
|
2024-07-20 14:16:26 +02:00
|
|
|
|
2026-04-09 16:48:22 +00:00
|
|
|
export function ChatPageWrapper(
|
|
|
|
|
coreViewModel: CoreViewModel,
|
|
|
|
|
chatListViewModel: ChatListViewModel,
|
|
|
|
|
) {
|
2026-04-01 08:29:39 +00:00
|
|
|
const chatPageContent = React.createProxyState(
|
|
|
|
|
[chatListViewModel.selectedChat],
|
|
|
|
|
() => {
|
|
|
|
|
if (chatListViewModel.selectedChat.value == undefined) {
|
|
|
|
|
return <div></div>;
|
|
|
|
|
} else {
|
2026-04-09 16:48:22 +00:00
|
|
|
return ChatPage(
|
|
|
|
|
coreViewModel,
|
|
|
|
|
chatListViewModel.selectedChat.value,
|
|
|
|
|
);
|
2026-04-01 08:29:39 +00:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
);
|
2024-07-20 14:16:26 +02:00
|
|
|
|
2026-04-01 08:29:39 +00:00
|
|
|
return <div id="chat-page-wrapper" children:set={chatPageContent}></div>;
|
2024-07-20 14:16:26 +02:00
|
|
|
}
|