import { showDialog } from "./Dialog"; import * as utils from "../helpers/utils"; import "../less/preview-image-dialog.less"; interface Props extends DialogProps { imgUrl: string; } const PreviewImageDialog: React.FC = ({ destroy, imgUrl }: Props) => { const handleCloseBtnClick = () => { destroy(); }; const handleDownloadBtnClick = () => { const a = document.createElement("a"); a.href = imgUrl; a.download = `memos-${utils.getDateTimeString(Date.now())}.png`; a.click(); }; return ( <>
); }; export default function showPreviewImageDialog(imgUrl: string): void { showDialog( { className: "preview-image-dialog", }, PreviewImageDialog, { imgUrl } ); }