UNPKG

lightning-auth-and-payment

Version:

Lightning Network authentication and payment processing library for modern web applications

22 lines 1.48 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.LnurlAuthQRCode = exports.LightningQRCode = exports.QRCode = void 0; const jsx_runtime_1 = require("react/jsx-runtime"); const qrcode_react_1 = require("qrcode.react"); const QRCode = ({ value, size = 256, level = "M", includeMargin = true, marginSize = 4, bgColor = "#FFFFFF", fgColor = "#000000", className, }) => { return ((0, jsx_runtime_1.jsx)(qrcode_react_1.QRCodeSVG, { value: value, size: size, level: level, includeMargin: includeMargin, marginSize: marginSize, bgColor: bgColor, fgColor: fgColor, className: className })); }; exports.QRCode = QRCode; const LightningQRCode = ({ bolt11, lnurl, size = 256, className, }) => { const value = bolt11 || lnurl || ""; if (!value) { return ((0, jsx_runtime_1.jsx)("div", { className: `flex items-center justify-center bg-gray-100 ${className}`, style: { width: size, height: size }, children: (0, jsx_runtime_1.jsx)("span", { className: "text-gray-500 text-sm", children: "No QR Code" }) })); } return (0, jsx_runtime_1.jsx)(exports.QRCode, { value: value, size: size, level: "M", className: className }); }; exports.LightningQRCode = LightningQRCode; const LnurlAuthQRCode = ({ lnurl, size = 256, className, }) => { return (0, jsx_runtime_1.jsx)(exports.QRCode, { value: lnurl, size: size, level: "M", className: className }); }; exports.LnurlAuthQRCode = LnurlAuthQRCode; //# sourceMappingURL=QRCode.js.map