import { Modal, QRCode, Space } from "antd"
import React from "react"

interface Props {
    url: string,
    visible?: boolean
    onClose?: () => void
}

/**
 * 
 * @param param0 
 * @returns 
 */
const ShowQrCode: React.FC<Props> = ({ url, visible, onClose }) => <Modal
    title="预览二维码"
    open={visible}
    onCancel={onClose}
    footer={null}
    width={332}
>
    <Space align="center" direction='vertical'>
        <QRCode value={url} size={300} />
        <span>{url}</span>
    </Space>
</Modal>

export default React.memo(ShowQrCode)