import { AmountJson, Amounts, parsePaytoUri, PaytoUri, } from "@gnu-taler/taler-util"; import { Fragment, h, VNode } from "preact"; import { useEffect, useState } from "preact/hooks"; import { QR } from "../components/QR"; import { ButtonDestructive, ButtonPrimary, WalletBox, WarningBox, } from "../components/styled"; export interface Props { reservePub: string; payto: string; exchangeBaseUrl: string; amount: AmountJson; onBack: () => void; } interface BankDetailsProps { payto: PaytoUri; exchangeBaseUrl: string; subject: string; amount: string; } function Row({ name, value, literal, }: { name: string; value: string; literal?: boolean; }): VNode { const [copied, setCopied] = useState(false); function copyText(): void { navigator.clipboard.writeText(value); setCopied(true); } useEffect(() => { setTimeout(() => { setCopied(false); }, 1000); }, [copied]); return ( {!copied ? (   Copy   ) : ( Copied )} {name} {literal ? (
            {value}
          
) : ( {value} )} ); } function BankDetailsByPaytoType({ payto, subject, exchangeBaseUrl, amount, }: BankDetailsProps): VNode { const firstPart = !payto.isKnown ? ( ) : payto.targetType === "x-taler-bank" ? ( ) : payto.targetType === "iban" ? ( ) : undefined; return ( {firstPart}
); } export function ReserveCreated({ reservePub, payto, onBack, exchangeBaseUrl, amount, }: Props): VNode { const paytoURI = parsePaytoUri(payto); // const url = new URL(paytoURI?.targetPath); if (!paytoURI) { return
could not parse payto uri from exchange {payto}
; } return (

Bank transfer details

Please wire {Amounts.stringify(amount)} to:

Make sure to use the correct subject, otherwise the money will not arrive in this wallet.

Alternative, you can also scan this QR code or open{" "} this link if you have a banking app installed that supports RFC 8905

); }