blob: 4a58393cd59a703fa82080644ca0aff6fa1ab4af [file] [log] [blame]
simonf9d78f22022-11-25 15:47:15 -05001/*
2 * Copyright (C) 2022 Savoir-faire Linux Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Affero General Public License as
6 * published by the Free Software Foundation; either version 3 of the
7 * License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Affero General Public License for more details.
13 *
14 * You should have received a copy of the GNU Affero General Public
15 * License along with this program. If not, see
16 * <https://www.gnu.org/licenses/>.
17 */
18import { Divider, Stack, Typography } from '@mui/material';
simonf9d78f22022-11-25 15:47:15 -050019
idillon255682e2023-02-06 13:25:26 -050020import { useCallManagerContext } from '../contexts/CallManagerProvider';
simon09fe4822022-11-30 23:36:25 -050021import { useConversationContext } from '../contexts/ConversationProvider';
simonf9d78f22022-11-25 15:47:15 -050022import ChatInterface from '../pages/ChatInterface';
23import { CloseButton } from './Button';
24
25export default () => {
26 return (
27 <Stack
28 width="33%"
29 height="100%"
30 sx={{
31 backgroundColor: 'white',
32 }}
33 >
34 <CallChatDrawerHeader />
35 <Divider
36 sx={{
37 borderTop: '1px solid #E5E5E5',
38 }}
39 />
40 <ChatInterface />
41 </Stack>
42 );
43};
44
45const CallChatDrawerHeader = () => {
idillon255682e2023-02-06 13:25:26 -050046 const { setIsChatShown } = useCallManagerContext();
idillon07d31cc2022-12-06 22:40:14 -050047 const { conversationDisplayName } = useConversationContext();
simonf9d78f22022-11-25 15:47:15 -050048
49 return (
50 <Stack direction="row" padding={2} spacing={2} alignItems="center">
51 <CloseButton
52 onClick={() => {
53 setIsChatShown(false);
54 }}
55 />
56 <Stack direction="column">
57 <Typography variant="h3" textOverflow="ellipsis">
idillon07d31cc2022-12-06 22:40:14 -050058 {conversationDisplayName}
simonf9d78f22022-11-25 15:47:15 -050059 </Typography>
60 </Stack>
61 </Stack>
62 );
63};