2022-04-28 18:54:33 +02:00
|
|
|
import Sider from 'antd/lib/layout/Sider';
|
|
|
|
import { useRecoilValue } from 'recoil';
|
2022-04-28 14:36:05 -07:00
|
|
|
import { ChatMessage } from '../../../interfaces/chat-message.model';
|
2022-05-22 15:05:40 +02:00
|
|
|
import { ChatContainer, ChatTextField } from '../../chat';
|
2022-05-04 09:55:44 +02:00
|
|
|
import s from './Sidebar.module.scss';
|
2022-05-02 17:45:22 -07:00
|
|
|
import {
|
|
|
|
chatMessagesAtom,
|
|
|
|
chatVisibilityAtom,
|
|
|
|
chatStateAtom,
|
|
|
|
} from '../../stores/ClientConfigStore';
|
|
|
|
import { ChatState, ChatVisibilityState } from '../../../interfaces/application-state';
|
2022-04-28 18:54:33 +02:00
|
|
|
|
|
|
|
export default function Sidebar() {
|
2022-05-02 17:45:22 -07:00
|
|
|
const messages = useRecoilValue<ChatMessage[]>(chatMessagesAtom);
|
2022-04-29 15:09:53 -07:00
|
|
|
const chatVisibility = useRecoilValue<ChatVisibilityState>(chatVisibilityAtom);
|
2022-05-02 17:45:22 -07:00
|
|
|
const chatState = useRecoilValue<ChatState>(chatStateAtom);
|
2022-04-28 14:36:05 -07:00
|
|
|
|
2022-04-28 18:54:33 +02:00
|
|
|
return (
|
|
|
|
<Sider
|
2022-05-17 16:36:07 +02:00
|
|
|
className={s.root}
|
2022-04-29 15:09:53 -07:00
|
|
|
collapsed={chatVisibility === ChatVisibilityState.Hidden}
|
2022-05-02 17:45:22 -07:00
|
|
|
collapsedWidth={0}
|
2022-05-17 16:36:07 +02:00
|
|
|
width={320}
|
2022-04-28 14:36:05 -07:00
|
|
|
>
|
2022-05-17 17:58:51 -07:00
|
|
|
<ChatContainer messages={messages} state={chatState} />
|
|
|
|
<ChatTextField />
|
2022-04-28 14:36:05 -07:00
|
|
|
</Sider>
|
2022-04-28 18:54:33 +02:00
|
|
|
);
|
|
|
|
}
|