2022-09-05 07:46:54 +03:00
|
|
|
import { useRecoilValue } from 'recoil';
|
|
|
|
import { ChatMessage } from '../../../../interfaces/chat-message.model';
|
2022-09-07 10:00:28 +03:00
|
|
|
import { ChatContainer } from '../../../../components/chat/ChatContainer/ChatContainer';
|
2022-09-05 07:46:54 +03:00
|
|
|
import {
|
|
|
|
ClientConfigStore,
|
2022-10-11 02:26:09 +03:00
|
|
|
currentUserAtom,
|
2022-09-05 07:46:54 +03:00
|
|
|
visibleChatMessagesSelector,
|
|
|
|
} from '../../../../components/stores/ClientConfigStore';
|
|
|
|
|
|
|
|
export default function ReadOnlyChatEmbed() {
|
2022-10-11 02:26:09 +03:00
|
|
|
const currentUser = useRecoilValue(currentUserAtom);
|
2022-09-05 07:46:54 +03:00
|
|
|
const messages = useRecoilValue<ChatMessage[]>(visibleChatMessagesSelector);
|
2022-10-11 02:26:09 +03:00
|
|
|
if (!currentUser) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
const { id, displayName } = currentUser;
|
2022-09-05 07:46:54 +03:00
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<ClientConfigStore />
|
|
|
|
<ChatContainer
|
|
|
|
messages={messages}
|
2022-10-11 02:26:09 +03:00
|
|
|
usernameToHighlight={displayName}
|
|
|
|
chatUserId={id}
|
2022-09-05 07:46:54 +03:00
|
|
|
isModerator={false}
|
|
|
|
showInput={false}
|
|
|
|
height="100vh"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|