import QRCode from 'qrcode.react' import { InputGroup } from 'react-bootstrap' import Moon from '../svgs/moon-fill.svg' import copy from 'clipboard-copy' import Thumb from '../svgs/thumb-up-fill.svg' import { useState } from 'react' import BootstrapForm from 'react-bootstrap/Form' import Button from 'react-bootstrap/Button' import Check from '../svgs/check-double-line.svg' import Fail from '../svgs/close-line.svg' export function Invoice ({ invoice }) { const [copied, setCopied] = useState(false) const qrValue = 'lightning:' + invoice.bolt11.toUpperCase() let InvoiceStatus = InvoiceDefaultStatus let status = 'waiting for you' if (invoice.confirmedAt) { InvoiceStatus = InvoiceConfirmedStatus status = `${invoice.msatsReceived / 1000} sats deposited` } else if (invoice.cancelled) { InvoiceStatus = InvoiceFailedStatus status = 'cancelled' } else if (invoice.expiresAt <= new Date()) { InvoiceStatus = InvoiceFailedStatus status = 'expired' } return ( <>