import QRCode from 'qrcode.react' import { CopyInput, InputSkeleton } from './form' import InvoiceStatus from './invoice-status' import { requestProvider } from 'webln' import { useEffect } from 'react' export default function Qr ({ asIs, value, webLn, statusVariant, description, status }) { const qrValue = asIs ? value : 'lightning:' + value.toUpperCase() useEffect(() => { async function effect () { if (webLn) { try { const provider = await requestProvider() await provider.sendPayment(value) } catch (e) { console.log(e.message) } } } effect() }, []) return ( <> {description &&
{description}
}
) } export function QrSkeleton ({ status, description }) { return ( <>
{description &&
.
}
) }