fix: render ChatContent as DashboardLayout child so useChat has ChatProvider in scope

This commit is contained in:
Matthias Hochmeister
2026-03-27 18:03:54 +01:00
parent c1b4a92a12
commit 60e1329815

View File

@@ -10,7 +10,7 @@ import { notificationsApi } from '../services/notifications';
import ChatRoomList from '../components/chat/ChatRoomList';
import ChatMessageView from '../components/chat/ChatMessageView';
const ChatPage: React.FC = () => {
const ChatContent: React.FC = () => {
const { rooms, selectedRoomToken, connected } = useChat();
const queryClient = useQueryClient();
const markedRoomsRef = React.useRef(new Set<string>());
@@ -44,7 +44,6 @@ const ChatPage: React.FC = () => {
}, [selectedRoomToken, queryClient]);
return (
<DashboardLayout>
<Box
sx={{
height: 'calc(100vh - 112px)',
@@ -91,6 +90,13 @@ const ChatPage: React.FC = () => {
</>
)}
</Box>
);
};
const ChatPage: React.FC = () => {
return (
<DashboardLayout>
<ChatContent />
</DashboardLayout>
);
};