| 19 | import { ModalContent, ModalFooter }from '../../../static/js/components/ModalContent'; |
| 20 | |
| 21 | export default function UrlDialogContent({ url, helpFile, onClose }) { |
| 22 | return ( |
| 23 | <ModalContent> |
| 24 | <Box flexGrow="1"> |
| 25 | <iframe src={url} title=" " width="100%" height="100%" onLoad={(e)=>{ |
| 26 | e.target?.contentWindow?.focus(); |
| 27 | }}/> |
| 28 | </Box> |
| 29 | <ModalFooter> |
| 30 | <Box style={{ marginRight: 'auto' }}> |
| 31 | <PgIconButton data-test={'help-'+helpFile} title={gettext('Help')} icon={<HelpIcon />} onClick={() => { |
| 32 | let _url = url_for('help.static', { |
| 33 | 'filename': helpFile, |
| 34 | }); |
| 35 | window.open(_url, 'pgadmin_help'); |
| 36 | }} > |
| 37 | </PgIconButton> |
| 38 | </Box> |
| 39 | <DefaultButton data-test="close" startIcon={<CloseIcon />} onClick={() => { |
| 40 | onClose(); |
| 41 | }} >{gettext('Close')}</DefaultButton> |
| 42 | </ModalFooter> |
| 43 | </ModalContent> |
| 44 | ); |
| 45 | } |
| 46 | |
| 47 | UrlDialogContent.propTypes = { |
| 48 | url: PropTypes.string, |