import React from 'react'; import PropTypes from 'prop-types'; import './ImageLightbox.scss'; import FileSaver from 'file-saver'; import Text from '../../atoms/text/Text'; import RawModal from '../../atoms/modal/RawModal'; import IconButton from '../../atoms/button/IconButton'; import DownloadSVG from '../../../../public/res/ic/outlined/download.svg'; import ExternalSVG from '../../../../public/res/ic/outlined/external.svg'; function ImageLightbox({ url, alt, isOpen, onRequestClose, }) { const handleDownload = () => { FileSaver.saveAs(url, alt); }; return (
{alt} window.open(url)} size="small" src={ExternalSVG} />
{alt}
); } ImageLightbox.propTypes = { url: PropTypes.string.isRequired, alt: PropTypes.string.isRequired, isOpen: PropTypes.bool.isRequired, onRequestClose: PropTypes.func.isRequired, }; export default ImageLightbox;