summaryrefslogtreecommitdiff
path: root/packages/auditor-backoffice-ui/src/hooks/config.ts
diff options
context:
space:
mode:
authorNic Eigel <nic@eigel.ch>2024-04-26 13:10:29 +0200
committerNic Eigel <nic@eigel.ch>2024-04-26 13:10:29 +0200
commitdf64119729e9d55430c3b9133d660c431070f67b (patch)
tree4a6467a4920208e82892b3bb587a7c5664ebff76 /packages/auditor-backoffice-ui/src/hooks/config.ts
parent14090fa4f21b736ea7068f27d97a2c8acb57ee7e (diff)
downloadwallet-core-df64119729e9d55430c3b9133d660c431070f67b.tar.gz
wallet-core-df64119729e9d55430c3b9133d660c431070f67b.tar.bz2
wallet-core-df64119729e9d55430c3b9133d660c431070f67b.zip
incomplete changes to be more like merchant backend
Diffstat (limited to 'packages/auditor-backoffice-ui/src/hooks/config.ts')
-rw-r--r--packages/auditor-backoffice-ui/src/hooks/config.ts24
1 files changed, 24 insertions, 0 deletions
diff --git a/packages/auditor-backoffice-ui/src/hooks/config.ts b/packages/auditor-backoffice-ui/src/hooks/config.ts
new file mode 100644
index 000000000..a57fa15d5
--- /dev/null
+++ b/packages/auditor-backoffice-ui/src/hooks/config.ts
@@ -0,0 +1,24 @@
+/*
+ This file is part of GNU Taler
+ (C) 2021-2024 Taler Systems S.A.
+
+ GNU Taler is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+
+import { createContext } from "preact";
+import { useContext } from "preact/hooks";
+import { AuditorBackend } from "../declaration.js";
+
+const Context = createContext<AuditorBackend.VersionResponse>(null!);
+
+export const ConfigContextProvider = Context.Provider;
+export const useConfigContext = (): AuditorBackend.VersionResponse => useContext(Context);