2022-04-28 19:54:33 +03:00
|
|
|
import Sider from 'antd/lib/layout/Sider';
|
|
|
|
import { useRecoilValue } from 'recoil';
|
2022-04-29 00:36:05 +03:00
|
|
|
import { ChatMessage } from '../../../interfaces/chat-message.model';
|
2022-05-22 16:05:40 +03:00
|
|
|
import { ChatContainer, ChatTextField } from '../../chat';
|
2022-05-04 10:55:44 +03:00
|
|
|
import s from './Sidebar.module.scss';
|
2022-05-26 06:38:40 +03:00
|
|
|
|
|
|
|
import { chatMessagesAtom, appStateAtom } from '../../stores/ClientConfigStore';
|
|
|
|
import { AppStateOptions } from '../../stores/application-state';
|
2022-04-28 19:54:33 +03:00
|
|
|
|
|
|
|
export default function Sidebar() {
|
2022-05-03 03:45:22 +03:00
|
|
|
const messages = useRecoilValue<ChatMessage[]>(chatMessagesAtom);
|
2022-05-26 06:38:40 +03:00
|
|
|
const appState = useRecoilValue<AppStateOptions>(appStateAtom);
|
2022-04-29 00:36:05 +03:00
|
|
|
|
2022-04-28 19:54:33 +03:00
|
|
|
return (
|
2022-05-26 06:38:40 +03:00
|
|
|
<Sider className={s.root} collapsedWidth={0} width={320}>
|
|
|
|
<ChatContainer messages={messages} loading={appState.chatLoading} />
|
2022-05-18 03:58:51 +03:00
|
|
|
<ChatTextField />
|
2022-04-29 00:36:05 +03:00
|
|
|
</Sider>
|
2022-04-28 19:54:33 +03:00
|
|
|
);
|
|
|
|
}
|