| 1 |
import Dialog from '@elementor/ui/Dialog'; |
| 2 |
import DialogActions from '@elementor/ui/DialogActions'; |
| 3 |
import DialogContent from '@elementor/ui/DialogContent'; |
| 4 |
import DialogContentText from '@elementor/ui/DialogContentText'; |
| 5 |
import DialogHeader from '@elementor/ui/DialogHeader'; |
| 6 |
import DialogTitle from '@elementor/ui/DialogTitle'; |
| 7 |
import Button from '@elementor/ui/Button'; |
| 8 |
import Typography from '@elementor/ui/Typography'; |
| 9 |
import { __ } from '@wordpress/i18n'; |
| 10 |
|
| 11 |
export const DialogModal = ( |
| 12 |
{ |
| 13 |
onClose, |
| 14 |
approveButtonText, |
| 15 |
approveButtonOnClick, |
| 16 |
approveButtonUrl, |
| 17 |
title, |
| 18 |
text, |
| 19 |
isLoading, |
| 20 |
}, |
| 21 |
) => { |
| 22 |
return ( |
| 23 |
<Dialog |
| 24 |
open |
| 25 |
onClose={ onClose } |
| 26 |
aria-labelledby="alert-dialog-title" |
| 27 |
aria-describedby="alert-dialog-description" |
| 28 |
sx={ { zIndex: 100001 } } |
| 29 |
> |
| 30 |
<DialogHeader onClose={ () => onClose() }> |
| 31 |
<DialogTitle><Typography sx={ { color: 'text.secondary' } }>{ title }</Typography></DialogTitle> |
| 32 |
</DialogHeader> |
| 33 |
|
| 34 |
<DialogContent > |
| 35 |
<DialogContentText id="alert-dialog-description"> |
| 36 |
{ text } |
| 37 |
</DialogContentText> |
| 38 |
</DialogContent> |
| 39 |
|
| 40 |
<DialogActions> |
| 41 |
<Button onClick={ onClose } color="secondary"> |
| 42 |
{ __( 'Cancel', 'hello-plus' ) } |
| 43 |
</Button> |
| 44 |
<Button disabled={ isLoading } target="_blank" rel="opener" href={ approveButtonUrl } onClick={ approveButtonOnClick } variant="contained"> |
| 45 |
{ isLoading ? __( 'Processing…', 'hello-plus' ) : approveButtonText } |
| 46 |
</Button> |
| 47 |
</DialogActions> |
| 48 |
</Dialog> |
| 49 |
); |
| 50 |
}; |
| 51 |
|