import QRCode from 'qrcode.react'
import { CopyInput, InputSkeleton } from './form'
import InvoiceStatus from './invoice-status'
import { useEffect } from 'react'
import { useWebLN } from './webln'
import Bolt11Info from './bolt11-info'
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) {
try {
await provider.sendPayment(value)
} catch (e) {
console.log(e?.message)
}
}
}
effect()
}, [provider])
return (
<>