import { QRCodeSVG } from 'qrcode.react' import { CopyInput, InputSkeleton } from './form' import InvoiceStatus from './invoice-status' import { useEffect } from 'react' import { useWallet } from '@/wallets/index' import Bolt11Info from './bolt11-info' export const qrImageSettings = { src: 'data:image/svg+xml,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 256 256\'%3E%3Cpath fill-rule=\'evenodd\' d=\'m46.7 96.4 37.858 53.837-71.787 62.934L117.5 155.4l-40.075-52.854 49.412-59.492Zm156.35 41.546-49.416-58.509-34.909 116.771 44.25-67.358 58.509 59.25L241.4 47.725Z\'/%3E%3C/svg%3E', x: undefined, y: undefined, height: 60, width: 60, excavate: true } export default function Qr ({ asIs, value, useWallet: automated, statusVariant, description, status }) { const qrValue = asIs ? value : 'lightning:' + value.toUpperCase() const wallet = useWallet() useEffect(() => { async function effect () { if (automated && wallet) { try { await wallet.sendPayment(value) } catch (e) { console.log(e?.message) } } } effect() }, [wallet]) return ( <> {description &&
{description}
}
) } export function QrSkeleton ({ status, description, bolt11Info }) { return ( <>
{description &&
i'm invisible
}
{bolt11Info && } ) }