diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/Invoice/state.ts')
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/Invoice/state.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/Invoice/state.ts b/packages/taler-wallet-webextension/src/wallet/Invoice/state.ts index 45b174063..48cfd359b 100644 --- a/packages/taler-wallet-webextension/src/wallet/Invoice/state.ts +++ b/packages/taler-wallet-webextension/src/wallet/Invoice/state.ts @@ -14,6 +14,8 @@ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ +import { Amounts } from "@gnu-taler/taler-util"; +import { useState } from "preact/hooks"; import * as wxApi from "../../wxApi.js"; import { Props, State } from "./index.js"; @@ -21,8 +23,15 @@ export function useComponentState( { p }: Props, api: typeof wxApi, ): State { + const [subject, setSubject] = useState(""); + const amount = Amounts.parseOrThrow("ARS:0") return { status: "ready", + subject: { + value: subject, + onInput: async (e) => setSubject(e) + }, + amount, error: undefined, } } |