@@ -88,6 +88,11 @@ const ViewTicketsPage: React.FC = () => {
8888 const [ confirmButtonEnabled , setConfirmButtonEnabled ] = useState ( false ) ;
8989 const [ countdown , setCountdown ] = useState ( 3 ) ;
9090
91+ // Email copy confirmation modal states
92+ const [ showCopyEmailModal , setShowCopyEmailModal ] = useState ( false ) ;
93+ const [ pendingCopyMode , setPendingCopyMode ] =
94+ useState < TicketsCopyMode | null > ( null ) ;
95+
9196 useEffect ( ( ) => {
9297 if ( showConfirmModal ) {
9398 setConfirmButtonEnabled ( false ) ;
@@ -129,6 +134,24 @@ const ViewTicketsPage: React.FC = () => {
129134 }
130135 } , [ showConfirmModal ] ) ;
131136
137+ const handleCopyEmailsClick = ( mode : TicketsCopyMode ) => {
138+ setPendingCopyMode ( mode ) ;
139+ setShowCopyEmailModal ( true ) ;
140+ } ;
141+
142+ const handleCloseCopyEmailModal = ( ) => {
143+ setShowCopyEmailModal ( false ) ;
144+ setPendingCopyMode ( null ) ;
145+ } ;
146+
147+ const handleConfirmCopyEmails = ( ) => {
148+ if ( pendingCopyMode === null ) {
149+ return ;
150+ }
151+ copyEmails ( pendingCopyMode ) ;
152+ handleCloseCopyEmailModal ( ) ;
153+ } ;
154+
132155 const copyEmails = ( mode : TicketsCopyMode ) => {
133156 try {
134157 let emailsToCopy : string [ ] = [ ] ;
@@ -280,21 +303,21 @@ const ViewTicketsPage: React.FC = () => {
280303 < Group mt = "md" >
281304 < Button
282305 onClick = { ( ) => {
283- copyEmails ( TicketsCopyMode . ALL ) ;
306+ handleCopyEmailsClick ( TicketsCopyMode . ALL ) ;
284307 } }
285308 >
286309 Copy All Emails
287310 </ Button >
288311 < Button
289312 onClick = { ( ) => {
290- copyEmails ( TicketsCopyMode . FULFILLED ) ;
313+ handleCopyEmailsClick ( TicketsCopyMode . FULFILLED ) ;
291314 } }
292315 >
293316 Copy Fulfilled Emails
294317 </ Button >
295318 < Button
296319 onClick = { ( ) => {
297- copyEmails ( TicketsCopyMode . UNFULFILLED ) ;
320+ handleCopyEmailsClick ( TicketsCopyMode . UNFULFILLED ) ;
298321 } }
299322 >
300323 Copy Unfulfilled Emails
@@ -459,6 +482,40 @@ const ViewTicketsPage: React.FC = () => {
459482 </ Group >
460483 </ Stack >
461484 </ Modal >
485+
486+ { /* Copy Emails Confirmation Modal */ }
487+ < Modal
488+ opened = { showCopyEmailModal }
489+ onClose = { handleCloseCopyEmailModal }
490+ title = "Copy Emails"
491+ size = "md"
492+ centered
493+ >
494+ < Stack >
495+ < Alert
496+ icon = { < IconAlertCircle size = { 16 } /> }
497+ title = "Privacy Notice"
498+ color = "yellow"
499+ variant = "light"
500+ >
501+ < Text size = "sm" fw = { 500 } >
502+ Be sure to BCC all recipients to avoid leaking the purchase list
503+ </ Text >
504+ </ Alert >
505+
506+ < Text size = "sm" >
507+ When composing your email, make sure to add all email addresses to
508+ the BCC field (not To or CC) to protect the privacy of your
509+ recipients.
510+ </ Text >
511+
512+ < Group justify = "flex-end" mt = "md" >
513+ < Button color = "blue" onClick = { handleConfirmCopyEmails } >
514+ I understand, copy emails
515+ </ Button >
516+ </ Group >
517+ </ Stack >
518+ </ Modal >
462519 </ AuthGuard >
463520 ) ;
464521} ;
0 commit comments