|
| 1 | +import type { IInboxViewProps } from './InboxView.types'; |
| 2 | +import styles from './InboxView.module.css'; |
| 3 | +import ContentWrapper from '../../atom/ContentWrapper/ContentWrapper'; |
| 4 | +import { Box, Button, Flex, Heading, IconButton, Text } from '@radix-ui/themes'; |
| 5 | +import { useState } from 'react'; |
| 6 | +import CallList from './parts/CallList'; |
| 7 | +import { SidebarSimpleIcon } from '@phosphor-icons/react'; |
| 8 | + |
| 9 | +const InboxView = ({ content, callList }: IInboxViewProps) => { |
| 10 | + const [callListCollapsed, setCallListCollapsed] = useState(false); |
| 11 | + |
| 12 | + return ( |
| 13 | + <ContentWrapper className={styles.inboxViewWrapper} overflow={'hidden'} height="100%"> |
| 14 | + <Flex width="100%" height="100%"> |
| 15 | + {!callListCollapsed && <CallList calls={callList} />} |
| 16 | + |
| 17 | + <Flex |
| 18 | + pb="4" |
| 19 | + minWidth={'250px'} |
| 20 | + gap="2" |
| 21 | + direction={'column'} |
| 22 | + position={'relative'} |
| 23 | + flexGrow={'1'} |
| 24 | + overflowY="scroll" |
| 25 | + overflowX="hidden" |
| 26 | + > |
| 27 | + <Flex |
| 28 | + justify="between" |
| 29 | + position="sticky" |
| 30 | + top={'0'} |
| 31 | + pt="4" |
| 32 | + px="4" |
| 33 | + pb="2" |
| 34 | + style={{ |
| 35 | + position: 'sticky', |
| 36 | + top: 0, |
| 37 | + backgroundColor: 'var(--gray-1)', |
| 38 | + zIndex: 1, |
| 39 | + paddingTop: 'var(--space-4)', |
| 40 | + paddingBottom: 'var(--space-2)', |
| 41 | + boxShadow: 'inset 0 -1px 0 0 var(--gray-a4)', |
| 42 | + paddingInline: 'var(--space-4)', |
| 43 | + marginRight: '1px', |
| 44 | + }} |
| 45 | + > |
| 46 | + <Flex gap="2"> |
| 47 | + <IconButton |
| 48 | + variant="ghost" |
| 49 | + size="2" |
| 50 | + color="gray" |
| 51 | + mt="1" |
| 52 | + onClick={() => { |
| 53 | + setCallListCollapsed((prev) => !prev); |
| 54 | + }} |
| 55 | + > |
| 56 | + <SidebarSimpleIcon weight="bold" size={20} aria-label="Toggle Call List" /> |
| 57 | + </IconButton> |
| 58 | + <Box> |
| 59 | + <Text size="2" color="gray"> |
| 60 | + January 1, 2024 at 12:00 AM |
| 61 | + </Text> |
| 62 | + <Heading size="6" mt="1"> |
| 63 | + New Year Sync |
| 64 | + </Heading> |
| 65 | + </Box> |
| 66 | + </Flex> |
| 67 | + <Box> |
| 68 | + <Button variant="outline" size="2" color="blue" mr="2"> |
| 69 | + Join Meeting |
| 70 | + </Button> |
| 71 | + <Button variant="outline" size="2" color="red"> |
| 72 | + Remove Agent |
| 73 | + </Button> |
| 74 | + </Box> |
| 75 | + </Flex> |
| 76 | + |
| 77 | + <Box px="4">{content}</Box> |
| 78 | + </Flex> |
| 79 | + </Flex> |
| 80 | + </ContentWrapper> |
| 81 | + ); |
| 82 | +}; |
| 83 | + |
| 84 | +export default InboxView; |
| 85 | +export type { IInboxViewProps }; |
0 commit comments