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