import QRCode from 'qrcode.react' import { CopyInput, InputSkeleton } from './form' import InvoiceStatus from './invoice-status' export function Invoice ({ invoice }) { const qrValue = 'lightning:' + invoice.bolt11.toUpperCase() let variant = 'default' let status = 'waiting for you' if (invoice.confirmedAt) { variant = 'confirmed' status = `${invoice.msatsReceived / 1000} sats deposited` } else if (invoice.cancelled) { variant = 'failed' status = 'cancelled' } else if (invoice.expiresAt <= new Date()) { variant = 'failed' status = 'expired' } return ( <>