simon | 575c940 | 2022-10-25 16:21:40 -0400 | [diff] [blame] | 1 | /* |
| 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 | */ |
idillon | 847b464 | 2022-12-29 14:28:38 -0500 | [diff] [blame] | 18 | import { Box, Stack, Typography } from '@mui/material'; |
idillon | 9e542ca | 2022-12-15 17:54:07 -0500 | [diff] [blame] | 19 | import dayjs from 'dayjs'; |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 20 | import { IConversationSummary } from 'jami-web-common'; |
simon | 575c940 | 2022-10-25 16:21:40 -0400 | [diff] [blame] | 21 | import { QRCodeCanvas } from 'qrcode.react'; |
simon | 21f7d9f | 2022-11-28 14:21:54 -0500 | [diff] [blame] | 22 | import { useCallback, useContext, useMemo, useState } from 'react'; |
simon | 4e7445c | 2022-11-16 21:18:46 -0500 | [diff] [blame] | 23 | import { useTranslation } from 'react-i18next'; |
simon | 21f7d9f | 2022-11-28 14:21:54 -0500 | [diff] [blame] | 24 | import { useNavigate } from 'react-router-dom'; |
simon | 575c940 | 2022-10-25 16:21:40 -0400 | [diff] [blame] | 25 | |
simon | 5da8ca6 | 2022-11-09 15:21:25 -0500 | [diff] [blame] | 26 | import { useAuthContext } from '../contexts/AuthProvider'; |
simon | e35acc2 | 2022-12-02 16:51:12 -0500 | [diff] [blame] | 27 | import { CallManagerContext } from '../contexts/CallManagerProvider'; |
Michelle Sepkap Sime | c050d9c | 2022-12-05 09:39:34 -0500 | [diff] [blame] | 28 | import { CallStatus, useCallContext } from '../contexts/CallProvider'; |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 29 | import { useUrlParams } from '../hooks/useUrlParams'; |
simon | 575c940 | 2022-10-25 16:21:40 -0400 | [diff] [blame] | 30 | import { setRefreshFromSlice } from '../redux/appSlice'; |
| 31 | import { useAppDispatch } from '../redux/hooks'; |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 32 | import { ConversationRouteParams } from '../router'; |
idillon | 9e542ca | 2022-12-15 17:54:07 -0500 | [diff] [blame] | 33 | import { getMessageCallText, getMessageMemberText } from '../utils/chatmessages'; |
| 34 | import { formatRelativeDate, formatTime } from '../utils/dates×'; |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 35 | import ContextMenu, { ContextMenuHandler, useContextMenuHandler } from './ContextMenu'; |
simon | 575c940 | 2022-10-25 16:21:40 -0400 | [diff] [blame] | 36 | import ConversationAvatar from './ConversationAvatar'; |
idillon | 847b464 | 2022-12-29 14:28:38 -0500 | [diff] [blame] | 37 | import { CustomListItemButton } from './CustomListItemButton'; |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 38 | import { ConfirmationDialog, DialogContentList, InfosDialog, useDialogHandler } from './Dialog'; |
| 39 | import { PopoverListItemData } from './PopoverList'; |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 40 | import { AudioCallIcon, CancelIcon, MessageIcon, PersonIcon, VideoCallIcon } from './SvgIcon'; |
simon | 575c940 | 2022-10-25 16:21:40 -0400 | [diff] [blame] | 41 | |
simon | 575c940 | 2022-10-25 16:21:40 -0400 | [diff] [blame] | 42 | type ConversationListItemProps = { |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 43 | conversationSummary: IConversationSummary; |
simon | 575c940 | 2022-10-25 16:21:40 -0400 | [diff] [blame] | 44 | }; |
| 45 | |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 46 | export default function ConversationListItem({ conversationSummary }: ConversationListItemProps) { |
idillon | 9e542ca | 2022-12-15 17:54:07 -0500 | [diff] [blame] | 47 | const { account } = useAuthContext(); |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 48 | const { |
| 49 | urlParams: { conversationId: selectedConversationId }, |
| 50 | } = useUrlParams<ConversationRouteParams>(); |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 51 | const contextMenuHandler = useContextMenuHandler(); |
simon | 575c940 | 2022-10-25 16:21:40 -0400 | [diff] [blame] | 52 | const navigate = useNavigate(); |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 53 | |
| 54 | const conversationId = conversationSummary.id; |
| 55 | const isSelected = conversationId === selectedConversationId; |
simon | ff1cb35 | 2022-11-24 15:15:26 -0500 | [diff] [blame] | 56 | |
simon | 21f7d9f | 2022-11-28 14:21:54 -0500 | [diff] [blame] | 57 | const onClick = useCallback(() => { |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 58 | if (conversationId) { |
| 59 | navigate(`/conversation/${conversationId}`); |
simon | 21f7d9f | 2022-11-28 14:21:54 -0500 | [diff] [blame] | 60 | } |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 61 | }, [navigate, conversationId]); |
simon | 21f7d9f | 2022-11-28 14:21:54 -0500 | [diff] [blame] | 62 | |
idillon | 847b464 | 2022-12-29 14:28:38 -0500 | [diff] [blame] | 63 | const conversationName = useMemo( |
| 64 | () => conversationSummary.title || conversationSummary.membersNames.join(', ') || account.getDisplayName(), |
| 65 | [account, conversationSummary] |
| 66 | ); |
| 67 | |
| 68 | return ( |
| 69 | <Box> |
| 70 | <ConversationMenu |
| 71 | conversationId={conversationId} |
| 72 | conversationName={conversationName} |
| 73 | onMessageClick={onClick} |
| 74 | isSelected={isSelected} |
| 75 | contextMenuProps={contextMenuHandler.props} |
| 76 | /> |
| 77 | <CustomListItemButton |
| 78 | selected={isSelected} |
| 79 | onClick={onClick} |
| 80 | onContextMenu={contextMenuHandler.handleAnchorPosition} |
| 81 | icon={<ConversationAvatar displayName={conversationName} />} |
| 82 | primaryText={<Typography variant="body1">{conversationName}</Typography>} |
| 83 | secondaryText={<SecondaryText conversationSummary={conversationSummary} isSelected={isSelected} />} |
| 84 | /> |
| 85 | </Box> |
| 86 | ); |
| 87 | } |
| 88 | |
| 89 | type SecondaryTextProps = { |
| 90 | conversationSummary: IConversationSummary; |
| 91 | isSelected: boolean; |
| 92 | }; |
| 93 | |
| 94 | const SecondaryText = ({ conversationSummary, isSelected }: SecondaryTextProps) => { |
| 95 | const { account } = useAuthContext(); |
| 96 | const callContext = useCallContext(true); |
| 97 | const { callData } = useContext(CallManagerContext); |
| 98 | const { t, i18n } = useTranslation(); |
| 99 | |
idillon | 9e542ca | 2022-12-15 17:54:07 -0500 | [diff] [blame] | 100 | const timeIndicator = useMemo(() => { |
| 101 | const message = conversationSummary.lastMessage; |
| 102 | const time = dayjs.unix(Number(message.timestamp)); |
| 103 | if (time.isToday()) { |
| 104 | return formatTime(time, i18n); |
| 105 | } else { |
| 106 | return formatRelativeDate(time, i18n); |
| 107 | } |
| 108 | }, [conversationSummary, i18n]); |
| 109 | |
| 110 | const lastMessageText = useMemo(() => { |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 111 | if (!callContext || !callData || callData.conversationId !== conversationSummary.id) { |
idillon | 9e542ca | 2022-12-15 17:54:07 -0500 | [diff] [blame] | 112 | const message = conversationSummary.lastMessage; |
| 113 | switch (message.type) { |
| 114 | case 'initial': { |
| 115 | return t('message_swarm_created'); |
| 116 | } |
| 117 | case 'application/data-transfer+json': { |
| 118 | return message.fileId; |
| 119 | } |
| 120 | case 'application/call-history+json': { |
| 121 | const isAccountMessage = message.author === account.getUri(); |
| 122 | return getMessageCallText(isAccountMessage, message, i18n); |
| 123 | } |
| 124 | case 'member': { |
| 125 | return getMessageMemberText(message, i18n); |
| 126 | } |
| 127 | case 'text/plain': { |
| 128 | return message.body; |
| 129 | } |
| 130 | default: { |
| 131 | console.error(`${ConversationListItem.name} received an unexpected lastMessage type: ${message.type}`); |
| 132 | return ''; |
| 133 | } |
| 134 | } |
Michelle Sepkap Sime | c050d9c | 2022-12-05 09:39:34 -0500 | [diff] [blame] | 135 | } |
| 136 | |
| 137 | if (callContext.callStatus === CallStatus.InCall) { |
| 138 | return callContext.isAudioOn ? t('ongoing_call_unmuted') : t('ongoing_call_muted'); |
| 139 | } |
| 140 | |
| 141 | if (callContext.callStatus === CallStatus.Connecting) { |
| 142 | return t('connecting_call'); |
| 143 | } |
| 144 | |
| 145 | return callContext.callRole === 'caller' ? t('outgoing_call') : t('incoming_call'); |
idillon | 9e542ca | 2022-12-15 17:54:07 -0500 | [diff] [blame] | 146 | }, [account, conversationSummary, callContext, callData, t, i18n]); |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 147 | |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 148 | return ( |
idillon | 847b464 | 2022-12-29 14:28:38 -0500 | [diff] [blame] | 149 | <Stack direction="row" spacing="5px"> |
| 150 | <Typography variant="body2" fontWeight={isSelected ? 'bold' : 'normal'}> |
| 151 | {timeIndicator} |
| 152 | </Typography> |
| 153 | <Typography variant="body2">{lastMessageText}</Typography> |
| 154 | </Stack> |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 155 | ); |
idillon | 847b464 | 2022-12-29 14:28:38 -0500 | [diff] [blame] | 156 | }; |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 157 | |
| 158 | interface ConversationMenuProps { |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 159 | conversationId: string; |
| 160 | conversationName: string; |
simon | 21f7d9f | 2022-11-28 14:21:54 -0500 | [diff] [blame] | 161 | onMessageClick: () => void; |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 162 | isSelected: boolean; |
| 163 | contextMenuProps: ContextMenuHandler['props']; |
| 164 | } |
| 165 | |
simon | 21f7d9f | 2022-11-28 14:21:54 -0500 | [diff] [blame] | 166 | const ConversationMenu = ({ |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 167 | conversationId, |
| 168 | conversationName, |
simon | 21f7d9f | 2022-11-28 14:21:54 -0500 | [diff] [blame] | 169 | onMessageClick, |
| 170 | isSelected, |
| 171 | contextMenuProps, |
| 172 | }: ConversationMenuProps) => { |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 173 | const { t } = useTranslation(); |
simon | e35acc2 | 2022-12-02 16:51:12 -0500 | [diff] [blame] | 174 | const { startCall } = useContext(CallManagerContext); |
simon | 416d079 | 2022-11-03 02:46:18 -0400 | [diff] [blame] | 175 | const [isSwarm] = useState(true); |
simon | 575c940 | 2022-10-25 16:21:40 -0400 | [diff] [blame] | 176 | |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 177 | const detailsDialogHandler = useDialogHandler(); |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 178 | const RemoveConversationDialogHandler = useDialogHandler(); |
simon | 575c940 | 2022-10-25 16:21:40 -0400 | [diff] [blame] | 179 | |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 180 | const navigate = useNavigate(); |
| 181 | |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 182 | const menuOptions: PopoverListItemData[] = useMemo( |
| 183 | () => [ |
| 184 | { |
| 185 | label: t('conversation_message'), |
| 186 | Icon: MessageIcon, |
simon | 21f7d9f | 2022-11-28 14:21:54 -0500 | [diff] [blame] | 187 | onClick: onMessageClick, |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 188 | }, |
| 189 | { |
| 190 | label: t('conversation_start_audiocall'), |
| 191 | Icon: AudioCallIcon, |
| 192 | onClick: () => { |
simon | ff1cb35 | 2022-11-24 15:15:26 -0500 | [diff] [blame] | 193 | if (conversationId) { |
simon | e35acc2 | 2022-12-02 16:51:12 -0500 | [diff] [blame] | 194 | startCall({ |
| 195 | conversationId, |
| 196 | role: 'caller', |
| 197 | }); |
simon | ff1cb35 | 2022-11-24 15:15:26 -0500 | [diff] [blame] | 198 | } |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 199 | }, |
| 200 | }, |
| 201 | { |
| 202 | label: t('conversation_start_videocall'), |
| 203 | Icon: VideoCallIcon, |
| 204 | onClick: () => { |
simon | ff1cb35 | 2022-11-24 15:15:26 -0500 | [diff] [blame] | 205 | if (conversationId) { |
simon | e35acc2 | 2022-12-02 16:51:12 -0500 | [diff] [blame] | 206 | startCall({ |
| 207 | conversationId, |
| 208 | role: 'caller', |
| 209 | withVideoOn: true, |
simon | ff1cb35 | 2022-11-24 15:15:26 -0500 | [diff] [blame] | 210 | }); |
| 211 | } |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 212 | }, |
| 213 | }, |
| 214 | ...(isSelected |
| 215 | ? [ |
| 216 | { |
| 217 | label: t('conversation_close'), |
| 218 | Icon: CancelIcon, |
| 219 | onClick: () => { |
| 220 | navigate(`/`); |
| 221 | }, |
| 222 | }, |
| 223 | ] |
| 224 | : []), |
| 225 | { |
| 226 | label: t('conversation_details'), |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 227 | Icon: PersonIcon, |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 228 | onClick: () => { |
| 229 | detailsDialogHandler.openDialog(); |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 230 | }, |
| 231 | }, |
| 232 | { |
| 233 | label: t('conversation_delete'), |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 234 | Icon: CancelIcon, |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 235 | onClick: () => { |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 236 | RemoveConversationDialogHandler.openDialog(); |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 237 | }, |
| 238 | }, |
| 239 | ], |
| 240 | [ |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 241 | navigate, |
simon | 21f7d9f | 2022-11-28 14:21:54 -0500 | [diff] [blame] | 242 | onMessageClick, |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 243 | isSelected, |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 244 | detailsDialogHandler, |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 245 | RemoveConversationDialogHandler, |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 246 | t, |
simon | ff1cb35 | 2022-11-24 15:15:26 -0500 | [diff] [blame] | 247 | startCall, |
| 248 | conversationId, |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 249 | ] |
| 250 | ); |
simon | 575c940 | 2022-10-25 16:21:40 -0400 | [diff] [blame] | 251 | |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 252 | return ( |
| 253 | <> |
| 254 | <ContextMenu {...contextMenuProps} items={menuOptions} /> |
| 255 | |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 256 | <DetailsDialog |
| 257 | {...detailsDialogHandler.props} |
| 258 | conversationId={conversationId} |
| 259 | conversationName={conversationName} |
| 260 | isSwarm={isSwarm} |
| 261 | /> |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 262 | |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 263 | <RemoveConversationDialog {...RemoveConversationDialogHandler.props} conversationId={conversationId} /> |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 264 | </> |
| 265 | ); |
| 266 | }; |
| 267 | |
| 268 | interface DetailsDialogProps { |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 269 | conversationId: string; |
| 270 | conversationName: string; |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 271 | open: boolean; |
| 272 | onClose: () => void; |
| 273 | isSwarm: boolean; |
| 274 | } |
| 275 | |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 276 | const DetailsDialog = ({ conversationId, conversationName, open, onClose, isSwarm }: DetailsDialogProps) => { |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 277 | const { t } = useTranslation(); |
| 278 | const items = useMemo( |
| 279 | () => [ |
| 280 | { |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 281 | label: t('conversation_details_name'), |
| 282 | value: conversationName, |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 283 | }, |
| 284 | { |
| 285 | label: t('conversation_details_identifier'), |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 286 | value: conversationId, |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 287 | }, |
| 288 | { |
| 289 | label: t('conversation_details_qr_code'), |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 290 | value: <QRCodeCanvas size={80} value={`${conversationId}`} />, |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 291 | }, |
| 292 | { |
| 293 | label: t('conversation_details_is_swarm'), |
| 294 | value: isSwarm ? t('conversation_details_is_swarm_true') : t('conversation_details_is_swarm_false'), |
| 295 | }, |
| 296 | ], |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 297 | [conversationId, conversationName, isSwarm, t] |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 298 | ); |
| 299 | return ( |
| 300 | <InfosDialog |
| 301 | open={open} |
| 302 | onClose={onClose} |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 303 | icon={<ConversationAvatar sx={{ width: 'inherit', height: 'inherit' }} displayName={conversationName} />} |
| 304 | title={conversationName} |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 305 | content={<DialogContentList title={t('conversation_details_informations')} items={items} />} |
| 306 | /> |
| 307 | ); |
| 308 | }; |
| 309 | |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 310 | interface RemoveConversationDialogProps { |
| 311 | conversationId: string; |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 312 | open: boolean; |
| 313 | onClose: () => void; |
| 314 | } |
| 315 | |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 316 | const RemoveConversationDialog = ({ conversationId, open, onClose }: RemoveConversationDialogProps) => { |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 317 | const { axiosInstance } = useAuthContext(); |
| 318 | const { t } = useTranslation(); |
| 319 | const dispatch = useAppDispatch(); |
| 320 | |
| 321 | const remove = async () => { |
| 322 | const controller = new AbortController(); |
| 323 | try { |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 324 | await axiosInstance.delete(`/conversations/${conversationId}`, { |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 325 | signal: controller.signal, |
| 326 | }); |
| 327 | dispatch(setRefreshFromSlice()); |
| 328 | } catch (e) { |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 329 | console.error(`Error removing conversation : `, e); |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 330 | dispatch(setRefreshFromSlice()); |
| 331 | } |
| 332 | onClose(); |
| 333 | }; |
| 334 | |
| 335 | return ( |
| 336 | <ConfirmationDialog |
| 337 | open={open} |
| 338 | onClose={onClose} |
| 339 | title={t('dialog_confirm_title_default')} |
| 340 | content={t('conversation_ask_confirm_remove')} |
| 341 | onConfirm={remove} |
| 342 | confirmButtonText={t('conversation_confirm_remove')} |
| 343 | /> |
| 344 | ); |
| 345 | }; |