@@ -4,6 +4,10 @@ import { useMessageBounceContext, useTranslationContext } from '../../context';
44import type { MouseEventHandler , PropsWithChildren } from 'react' ;
55
66import type { ModalProps } from '../Modal' ;
7+ import { Button } from '../Button' ;
8+ import clsx from 'clsx' ;
9+ import { IconExclamationCircle } from '../Icons' ;
10+ import { Prompt } from '../Dialog/base/Prompt' ;
711
812export type MessageBouncePromptProps = PropsWithChildren < Pick < ModalProps , 'onClose' > > ;
913
@@ -22,34 +26,58 @@ export function MessageBouncePrompt({ children, onClose }: MessageBouncePromptPr
2226 }
2327
2428 return (
25- < div className = 'str-chat__message-bounce-prompt' data-testid = 'message-bounce-prompt' >
26- < div className = 'str-chat__message-bounce-prompt-header' >
27- { children ?? t ( 'This message did not meet our content guidelines' ) }
28- </ div >
29- < div className = 'str-chat__message-bounce-actions' >
30- < button
31- className = 'str-chat__message-bounce-edit'
29+ < Prompt . Root
30+ className = 'str-chat__message-bounce-prompt'
31+ data-testid = 'message-bounce-prompt'
32+ >
33+ < Prompt . Header
34+ className = 'str-chat__message-bounce-prompt-header'
35+ Icon = { IconExclamationCircle }
36+ title = {
37+ ! children ? t ( 'This message did not meet our content guidelines' ) : undefined
38+ }
39+ >
40+ { children }
41+ </ Prompt . Header >
42+ < Prompt . Actions className = { 'str-chat__message-bounce-actions' } >
43+ < Button
44+ className = { clsx (
45+ 'str-chat__message-bounce-delete' ,
46+ 'str-chat__button--outline' ,
47+ 'str-chat__button--destructive' ,
48+ 'str-chat__button--size-md' ,
49+ ) }
50+ data-testid = 'message-bounce-delete'
51+ onClick = { createHandler ( handleDelete ) }
52+ >
53+ { t ( 'Delete' ) }
54+ </ Button >
55+ < Button
56+ className = { clsx (
57+ 'str-chat__message-bounce-edit' ,
58+ 'str-chat__button--outline' ,
59+ 'str-chat__button--secondary' ,
60+ 'str-chat__button--size-md' ,
61+ ) }
3262 data-testid = 'message-bounce-edit'
3363 onClick = { createHandler ( handleEdit ) }
3464 type = 'button'
3565 >
3666 { t ( 'Edit Message' ) }
37- </ button >
38- < button
39- className = 'str-chat__message-bounce-send'
67+ </ Button >
68+ < Button
69+ className = { clsx (
70+ 'str-chat__message-bounce-send' ,
71+ 'str-chat__button--outline' ,
72+ 'str-chat__button--secondary' ,
73+ 'str-chat__button--size-md' ,
74+ ) }
4075 data-testid = 'message-bounce-send'
4176 onClick = { createHandler ( handleRetry ) }
4277 >
4378 { t ( 'Send Anyway' ) }
44- </ button >
45- < button
46- className = 'str-chat__message-bounce-delete'
47- data-testid = 'message-bounce-delete'
48- onClick = { createHandler ( handleDelete ) }
49- >
50- { t ( 'Delete' ) }
51- </ button >
52- </ div >
53- </ div >
79+ </ Button >
80+ </ Prompt . Actions >
81+ </ Prompt . Root >
5482 ) ;
5583}
0 commit comments