You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
965 B
29 lines
965 B
import Sider from 'antd/lib/layout/Sider'; |
|
import { useRecoilValue } from 'recoil'; |
|
import { ChatMessage } from '../../../interfaces/chat-message.model'; |
|
import { ChatContainer, ChatTextField } from '../../chat'; |
|
import s from './Sidebar.module.scss'; |
|
import { |
|
chatMessagesAtom, |
|
chatVisibilityAtom, |
|
chatStateAtom, |
|
} from '../../stores/ClientConfigStore'; |
|
import { ChatState, ChatVisibilityState } from '../../../interfaces/application-state'; |
|
|
|
export default function Sidebar() { |
|
const messages = useRecoilValue<ChatMessage[]>(chatMessagesAtom); |
|
const chatVisibility = useRecoilValue<ChatVisibilityState>(chatVisibilityAtom); |
|
const chatState = useRecoilValue<ChatState>(chatStateAtom); |
|
|
|
return ( |
|
<Sider |
|
className={s.root} |
|
collapsed={chatVisibility === ChatVisibilityState.Hidden} |
|
collapsedWidth={0} |
|
width={320} |
|
> |
|
<ChatContainer messages={messages} state={chatState} /> |
|
<ChatTextField /> |
|
</Sider> |
|
); |
|
}
|
|
|