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 15:55:52 +03:00
|
|
|
import ChatContainer from '/components/chat/ChatContainer';
|
2022-05-04 10:55:44 +03:00
|
|
|
import s from './Sidebar.module.scss';
|
2022-05-03 03:45:22 +03:00
|
|
|
import {
|
|
|
|
chatMessagesAtom,
|
|
|
|
chatVisibilityAtom,
|
|
|
|
chatStateAtom,
|
|
|
|
} from '../../stores/ClientConfigStore';
|
|
|
|
import { ChatState, ChatVisibilityState } from '../../../interfaces/application-state';
|
2022-05-04 00:55:13 +03:00
|
|
|
import ChatTextField from '../../chat/ChatTextField/ChatTextField';
|
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-04-30 01:09:53 +03:00
|
|
|
const chatVisibility = useRecoilValue<ChatVisibilityState>(chatVisibilityAtom);
|
2022-05-03 03:45:22 +03:00
|
|
|
const chatState = useRecoilValue<ChatState>(chatStateAtom);
|
2022-04-29 00:36:05 +03:00
|
|
|
|
2022-04-28 19:54:33 +03:00
|
|
|
return (
|
|
|
|
<Sider
|
2022-05-17 17:36:07 +03:00
|
|
|
className={s.root}
|
2022-04-30 01:09:53 +03:00
|
|
|
collapsed={chatVisibility === ChatVisibilityState.Hidden}
|
2022-05-03 03:45:22 +03:00
|
|
|
collapsedWidth={0}
|
2022-05-17 17:36:07 +03:00
|
|
|
width={320}
|
2022-04-29 00:36:05 +03:00
|
|
|
>
|
2022-05-18 03:58:51 +03:00
|
|
|
<ChatContainer messages={messages} state={chatState} />
|
|
|
|
<ChatTextField />
|
2022-04-29 00:36:05 +03:00
|
|
|
</Sider>
|
2022-04-28 19:54:33 +03:00
|
|
|
);
|
|
|
|
}
|