simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 1 | import { Box, Chip, Divider, List, ListItemButton, ListItemText, Stack, Tooltip, Typography } from '@mui/material'; |
| 2 | import { styled } from '@mui/material/styles'; |
| 3 | import dayjs from 'dayjs'; |
| 4 | import isToday from 'dayjs/plugin/isToday'; |
| 5 | import isYesterday from 'dayjs/plugin/isYesterday'; |
| 6 | import React, { useCallback, useMemo, useState } from 'react'; |
| 7 | import { useTranslation } from 'react-i18next'; |
simon | 07b4eb0 | 2022-09-29 17:50:26 -0400 | [diff] [blame] | 8 | |
simon | 3537869 | 2022-10-02 23:25:57 -0400 | [diff] [blame] | 9 | import { EmojiButton, MoreButton, ReplyMessageButton } from './Button.tsx'; |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 10 | import ConversationAvatar from './ConversationAvatar'; |
simon | 3537869 | 2022-10-02 23:25:57 -0400 | [diff] [blame] | 11 | import { OppositeArrowsIcon, TrashBinIcon, TwoSheetsIcon } from './SvgIcon.tsx'; |
Larbi Gharib | e9af973 | 2021-03-31 15:08:01 +0100 | [diff] [blame] | 12 | |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 13 | dayjs.extend(isToday); |
| 14 | dayjs.extend(isYesterday); |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 15 | |
| 16 | export const MessageCall = (props) => { |
simon | 80b7b3b | 2022-09-28 17:50:10 -0400 | [diff] [blame] | 17 | return <Stack alignItems="center">"Appel"</Stack>; |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 18 | }; |
Larbi Gharib | e9af973 | 2021-03-31 15:08:01 +0100 | [diff] [blame] | 19 | |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 20 | export const MessageInitial = (props) => { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 21 | const { t } = useTranslation(); |
| 22 | return <Stack alignItems="center">{t('message_swarm_created')}</Stack>; |
| 23 | }; |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 24 | |
| 25 | export const MessageDataTransfer = (props) => { |
| 26 | return ( |
| 27 | <MessageBubble |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 28 | backgroundColor={'#E5E5E5'} |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 29 | position={props.position} |
| 30 | isFirstOfGroup={props.isFirstOfGroup} |
| 31 | isLastOfGroup={props.isLastOfGroup} |
| 32 | > |
simon | 80b7b3b | 2022-09-28 17:50:10 -0400 | [diff] [blame] | 33 | "data-transfer" |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 34 | </MessageBubble> |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 35 | ); |
| 36 | }; |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 37 | |
| 38 | export const MessageMember = (props) => { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 39 | const { t } = useTranslation(); |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 40 | return ( |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 41 | <Stack alignItems="center"> |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 42 | <Chip |
| 43 | sx={{ |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 44 | width: 'fit-content', |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 45 | }} |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 46 | label={t('message_user_joined', { user: props.message.author })} |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 47 | /> |
| 48 | </Stack> |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 49 | ); |
| 50 | }; |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 51 | |
| 52 | export const MessageMerge = (props) => { |
simon | 80b7b3b | 2022-09-28 17:50:10 -0400 | [diff] [blame] | 53 | return <Stack alignItems="center">"merge"</Stack>; |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 54 | }; |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 55 | |
| 56 | export const MessageText = (props) => { |
| 57 | return ( |
| 58 | <MessageBubble |
| 59 | backgroundColor={props.bubbleColor} |
| 60 | position={props.position} |
| 61 | isFirstOfGroup={props.isFirstOfGroup} |
| 62 | isLastOfGroup={props.isLastOfGroup} |
| 63 | > |
idillon | 89720a8 | 2022-09-06 18:47:05 -0400 | [diff] [blame] | 64 | <Typography variant="body1" color={props.textColor} textAlign={props.position}> |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 65 | {props.message.body} |
| 66 | </Typography> |
| 67 | </MessageBubble> |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 68 | ); |
| 69 | }; |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 70 | |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 71 | export const MessageDate = ({ time }) => { |
| 72 | let textDate; |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 73 | |
| 74 | if (time.isToday()) { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 75 | textDate = 'Today'; |
| 76 | } else if (time.isYesterday()) { |
| 77 | textDate = 'Yesterday'; |
| 78 | } else { |
| 79 | const date = time.date().toString().padStart(2, '0'); |
| 80 | const month = (time.month() + 1).toString().padStart(2, '0'); |
| 81 | textDate = `${date}/${month}/${time.year()}`; |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 82 | } |
| 83 | |
| 84 | return ( |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 85 | <Box marginTop="30px"> |
idillon | 04245a1 | 2022-09-01 11:12:17 -0400 | [diff] [blame] | 86 | <Divider |
| 87 | sx={{ |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 88 | '.MuiDivider-wrapper': { |
idillon | 04245a1 | 2022-09-01 11:12:17 -0400 | [diff] [blame] | 89 | margin: 0, |
| 90 | padding: 0, |
| 91 | }, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 92 | '&::before': { |
| 93 | borderTop: '1px solid #E5E5E5', |
idillon | 04245a1 | 2022-09-01 11:12:17 -0400 | [diff] [blame] | 94 | }, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 95 | '&::after': { |
| 96 | borderTop: '1px solid #E5E5E5', |
idillon | 04245a1 | 2022-09-01 11:12:17 -0400 | [diff] [blame] | 97 | }, |
| 98 | }} |
| 99 | > |
| 100 | <Typography |
| 101 | variant="caption" |
| 102 | fontWeight={700} |
| 103 | border="1px solid #E5E5E5" |
| 104 | borderRadius="5px" |
| 105 | padding="10px 16px" |
| 106 | > |
| 107 | {textDate} |
| 108 | </Typography> |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 109 | </Divider> |
| 110 | </Box> |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 111 | ); |
| 112 | }; |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 113 | |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 114 | export const MessageTime = ({ time, hasDateOnTop }) => { |
| 115 | const hour = time.hour().toString().padStart(2, '0'); |
| 116 | const minute = time.minute().toString().padStart(2, '0'); |
| 117 | const textTime = `${hour}:${minute}`; |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 118 | |
| 119 | return ( |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 120 | <Stack direction="row" justifyContent="center" margin="30px" marginTop={hasDateOnTop ? '20px' : '30px'}> |
| 121 | <Typography variant="caption" color="#A7A7A7" fontWeight={700}> |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 122 | {textTime} |
| 123 | </Typography> |
| 124 | </Stack> |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 125 | ); |
| 126 | }; |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 127 | |
| 128 | export const MessageBubblesGroup = (props) => { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 129 | const isUser = false; // should access user from the store |
| 130 | const position = isUser ? 'end' : 'start'; |
| 131 | const bubbleColor = isUser ? '#005699' : '#E5E5E5'; |
| 132 | const textColor = isUser ? 'white' : 'black'; |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 133 | |
| 134 | return ( |
idillon | 89720a8 | 2022-09-06 18:47:05 -0400 | [diff] [blame] | 135 | <Stack // Row for a group of message bubbles with the user's infos |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 136 | direction="row" |
| 137 | justifyContent={position} |
idillon | 89720a8 | 2022-09-06 18:47:05 -0400 | [diff] [blame] | 138 | alignItems="end" |
| 139 | spacing="10px" |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 140 | > |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 141 | {!isUser && ( |
| 142 | <ConversationAvatar displayName="TempDisplayName" sx={{ width: '22px', height: '22px', fontSize: '15px' }} /> |
| 143 | )} |
idillon | 89720a8 | 2022-09-06 18:47:05 -0400 | [diff] [blame] | 144 | <Stack // Container to align the bubbles to the same side of a row |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 145 | width="66.66%" |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 146 | alignItems={position} |
| 147 | > |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 148 | <ParticipantName name={props.messages[0]?.author} position={position} /> |
idillon | 89720a8 | 2022-09-06 18:47:05 -0400 | [diff] [blame] | 149 | <Stack // Container for a group of message bubbles |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 150 | spacing="6px" |
| 151 | alignItems={position} |
| 152 | direction="column-reverse" |
| 153 | > |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 154 | {props.messages.map((message, index) => { |
| 155 | let Component; |
| 156 | switch (message.type) { |
| 157 | case 'text/plain': |
| 158 | Component = MessageText; |
| 159 | break; |
| 160 | case 'application/data-transfer+json': |
| 161 | Component = MessageDataTransfer; |
| 162 | break; |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 163 | } |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 164 | return ( |
| 165 | <Component // Single message |
| 166 | key={message.id} |
| 167 | message={message} |
| 168 | textColor={textColor} |
| 169 | position={position} |
| 170 | bubbleColor={bubbleColor} |
| 171 | isFirstOfGroup={index == props.messages.length - 1} |
| 172 | isLastOfGroup={index == 0} |
| 173 | /> |
| 174 | ); |
| 175 | })} |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 176 | </Stack> |
| 177 | </Stack> |
| 178 | </Stack> |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 179 | ); |
| 180 | }; |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 181 | |
idillon | 927b759 | 2022-09-15 12:56:45 -0400 | [diff] [blame] | 182 | const MessageTooltip = styled(({ className, ...props }) => { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 183 | const [open, setOpen] = useState(false); |
| 184 | const emojis = ['😎', '😄', '😍']; // Should be last three used emojis |
idillon | 927b759 | 2022-09-15 12:56:45 -0400 | [diff] [blame] | 185 | const additionalOptions = [ |
| 186 | { |
| 187 | Icon: TwoSheetsIcon, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 188 | text: 'Copy', |
idillon | 927b759 | 2022-09-15 12:56:45 -0400 | [diff] [blame] | 189 | action: () => {}, |
| 190 | }, |
| 191 | { |
| 192 | Icon: OppositeArrowsIcon, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 193 | text: 'Transfer', |
idillon | 927b759 | 2022-09-15 12:56:45 -0400 | [diff] [blame] | 194 | action: () => {}, |
| 195 | }, |
| 196 | { |
| 197 | Icon: TrashBinIcon, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 198 | text: 'Delete message', |
idillon | 927b759 | 2022-09-15 12:56:45 -0400 | [diff] [blame] | 199 | action: () => {}, |
| 200 | }, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 201 | ]; |
idillon | 927b759 | 2022-09-15 12:56:45 -0400 | [diff] [blame] | 202 | |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 203 | const toggleMoreMenu = useCallback(() => setOpen((open) => !open), [setOpen]); |
idillon | 927b759 | 2022-09-15 12:56:45 -0400 | [diff] [blame] | 204 | |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 205 | const onClose = useCallback(() => { |
| 206 | setOpen(false); |
| 207 | }, [setOpen]); |
idillon | 927b759 | 2022-09-15 12:56:45 -0400 | [diff] [blame] | 208 | |
| 209 | return ( |
| 210 | <Tooltip |
| 211 | {...props} |
| 212 | classes={{ tooltip: className }} // Required for styles. Don't know why |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 213 | placement={props.position == 'start' ? 'right-start' : 'left-start'} |
idillon | 927b759 | 2022-09-15 12:56:45 -0400 | [diff] [blame] | 214 | PopperProps={{ |
| 215 | modifiers: [ |
| 216 | { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 217 | name: 'offset', |
idillon | 927b759 | 2022-09-15 12:56:45 -0400 | [diff] [blame] | 218 | options: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 219 | offset: [-2, -30], |
idillon | 927b759 | 2022-09-15 12:56:45 -0400 | [diff] [blame] | 220 | }, |
| 221 | }, |
| 222 | ], |
| 223 | }} |
| 224 | onClose={onClose} |
| 225 | title={ |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 226 | <Stack> |
| 227 | {' '} |
| 228 | {/* Whole tooltip's content */} |
idillon | 927b759 | 2022-09-15 12:56:45 -0400 | [diff] [blame] | 229 | <Stack // Main options |
| 230 | direction="row" |
| 231 | spacing="16px" |
| 232 | > |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 233 | {emojis.map((emoji) => ( |
| 234 | <EmojiButton key={emoji} emoji={emoji} /> |
| 235 | ))} |
| 236 | <ReplyMessageButton /> |
| 237 | <MoreButton onClick={toggleMoreMenu} /> |
idillon | 927b759 | 2022-09-15 12:56:45 -0400 | [diff] [blame] | 238 | </Stack> |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 239 | {open && ( // Additional menu options |
idillon | 927b759 | 2022-09-15 12:56:45 -0400 | [diff] [blame] | 240 | <> |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 241 | <Divider sx={{ paddingTop: '16px' }} /> |
| 242 | <List sx={{ padding: 0, paddingTop: '8px', marginBottom: '-8px' }}> |
| 243 | {additionalOptions.map((option) => ( |
| 244 | <ListItemButton |
| 245 | key={option.text} |
| 246 | sx={{ |
| 247 | padding: '8px', |
| 248 | }} |
| 249 | > |
| 250 | <Stack // Could not find proper way to set spacing between ListItemIcon and ListItemText |
| 251 | direction="row" |
| 252 | spacing="16px" |
idillon | 927b759 | 2022-09-15 12:56:45 -0400 | [diff] [blame] | 253 | > |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 254 | <option.Icon |
| 255 | sx={{ |
| 256 | height: '16px', |
| 257 | margin: 0, |
| 258 | color: (theme) => theme.palette.primary.dark, |
| 259 | }} |
| 260 | /> |
| 261 | <ListItemText |
| 262 | primary={option.text} |
| 263 | primaryTypographyProps={{ |
| 264 | fontSize: '12px', |
| 265 | lineHeight: '16px', |
| 266 | }} |
| 267 | sx={{ |
| 268 | height: '16px', |
| 269 | margin: 0, |
| 270 | }} |
| 271 | /> |
| 272 | </Stack> |
| 273 | </ListItemButton> |
| 274 | ))} |
| 275 | </List> |
idillon | 927b759 | 2022-09-15 12:56:45 -0400 | [diff] [blame] | 276 | </> |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 277 | )} |
idillon | 927b759 | 2022-09-15 12:56:45 -0400 | [diff] [blame] | 278 | </Stack> |
| 279 | } |
| 280 | /> |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 281 | ); |
idillon | 927b759 | 2022-09-15 12:56:45 -0400 | [diff] [blame] | 282 | })(({ theme, position }) => { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 283 | const largeRadius = '20px'; |
| 284 | const smallRadius = '5px'; |
idillon | 927b759 | 2022-09-15 12:56:45 -0400 | [diff] [blame] | 285 | return { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 286 | backgroundColor: 'white', |
| 287 | padding: '16px', |
| 288 | boxShadow: '3px 3px 7px #00000029', |
idillon | 927b759 | 2022-09-15 12:56:45 -0400 | [diff] [blame] | 289 | borderRadius: largeRadius, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 290 | borderStartStartRadius: position == 'start' ? smallRadius : largeRadius, |
| 291 | borderStartEndRadius: position == 'end' ? smallRadius : largeRadius, |
| 292 | }; |
idillon | 927b759 | 2022-09-15 12:56:45 -0400 | [diff] [blame] | 293 | }); |
| 294 | |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 295 | const MessageBubble = (props) => { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 296 | const largeRadius = '20px'; |
| 297 | const smallRadius = '5px'; |
Adrien Béraud | 023f7cf | 2022-09-18 14:57:53 -0400 | [diff] [blame] | 298 | const radius = useMemo(() => { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 299 | if (props.position == 'start') { |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 300 | return { |
| 301 | borderStartStartRadius: props.isFirstOfGroup ? largeRadius : smallRadius, |
| 302 | borderStartEndRadius: largeRadius, |
| 303 | borderEndStartRadius: props.isLastOfGroup ? largeRadius : smallRadius, |
| 304 | borderEndEndRadius: largeRadius, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 305 | }; |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 306 | } |
| 307 | return { |
| 308 | borderStartStartRadius: largeRadius, |
| 309 | borderStartEndRadius: props.isFirstOfGroup ? largeRadius : smallRadius, |
| 310 | borderEndStartRadius: largeRadius, |
| 311 | borderEndEndRadius: props.isLastOfGroup ? largeRadius : smallRadius, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 312 | }; |
| 313 | }, [props.isFirstOfGroup, props.isLastOfGroup, props.position]); |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 314 | |
| 315 | return ( |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 316 | <MessageTooltip position={props.position}> |
idillon | 927b759 | 2022-09-15 12:56:45 -0400 | [diff] [blame] | 317 | <Box |
| 318 | sx={{ |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 319 | width: 'fit-content', |
idillon | 927b759 | 2022-09-15 12:56:45 -0400 | [diff] [blame] | 320 | backgroundColor: props.backgroundColor, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 321 | padding: '16px', |
idillon | 927b759 | 2022-09-15 12:56:45 -0400 | [diff] [blame] | 322 | ...radius, |
| 323 | }} |
| 324 | > |
| 325 | {props.children} |
| 326 | </Box> |
| 327 | </MessageTooltip> |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 328 | ); |
| 329 | }; |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 330 | |
| 331 | const ParticipantName = (props) => { |
| 332 | return ( |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 333 | <Box marginBottom="6px" marginLeft="16px" marginRight="16px"> |
| 334 | <Typography variant="caption" color="#A7A7A7" fontWeight={700}> |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 335 | {props.name} |
| 336 | </Typography> |
| 337 | </Box> |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 338 | ); |
| 339 | }; |