commit 4581f2e9ad365ef95424a3ff8b2f81b139d8fe68
parent cabec1c40e93b0ca531868910bf30c0e62ac1d40
Author: Sebastian <sebasjm@gmail.com>
Date: Sun, 23 Feb 2025 12:29:34 -0300
add ink to account
Diffstat:
2 files changed, 31 insertions(+), 6 deletions(-)
diff --git a/packages/aml-backoffice-ui/src/Routing.tsx b/packages/aml-backoffice-ui/src/Routing.tsx
@@ -285,7 +285,7 @@ function PrivateRouting(): VNode {
return <Dashboard routeToDownloadStats={privatePages.statsDownload} />;
}
case "transfers": {
- return <Transfers />;
+ return <Transfers routeToCaseById={privatePages.caseDetails} />;
}
default:
diff --git a/packages/aml-backoffice-ui/src/pages/Transfers.tsx b/packages/aml-backoffice-ui/src/pages/Transfers.tsx
@@ -3,6 +3,7 @@ import {
FormDesign,
FormUI,
Loading,
+ RouteDefinition,
Time,
UIHandlerId,
useExchangeApiContext,
@@ -17,6 +18,8 @@ import {
Amounts,
assertUnreachable,
CurrencySpecification,
+ encodeCrock,
+ hashNormalizedPaytoUri,
HttpStatusCode,
TalerError,
} from "@gnu-taler/taler-util";
@@ -24,7 +27,11 @@ import { ErrorLoadingWithDebug } from "../components/ErrorLoadingWithDebug.js";
import { Officer } from "./Officer.js";
import { format } from "date-fns";
-export function Transfers(): VNode {
+export function Transfers({
+ routeToCaseById,
+}: {
+ routeToCaseById: RouteDefinition<{ cid: string }>;
+}): VNode {
const { i18n, dateLocale } = useTranslationContext();
const { config } = useExchangeApiContext();
@@ -53,7 +60,7 @@ export function Transfers(): VNode {
{
type: "amount",
id: "threshold" as UIHandlerId,
- label: i18n.str`Threshold`,
+ label: i18n.str`Minimum amount`,
help: i18n.str`All amounts below the given threshold will be filtered.`,
currency: config.config.currency,
},
@@ -218,6 +225,10 @@ export function Transfers(): VNode {
</th>
</tr>
{txs.map((item) => {
+ const hashPayto = encodeCrock(
+ hashNormalizedPaytoUri(item.payto_uri),
+ );
+
return (
<tr
key={idx}
@@ -260,8 +271,15 @@ export function Transfers(): VNode {
<i18n.Translate>Account</i18n.Translate>
</dt>
<dd class="mt-1 truncate text-gray-500 sm:hidden">
- {isDebit ? i18n.str`to` : i18n.str`from`}{" "}
- {item.payto_uri}
+ <a
+ href={routeToCaseById.url({
+ cid: hashPayto,
+ })}
+ class="text-indigo-600 hover:text-indigo-900 font-mono"
+ >
+ {isDebit ? i18n.str`to` : i18n.str`from`}{" "}
+ {item.payto_uri}
+ </a>
</dd>
{/* <dd class="mt-1 text-gray-500 sm:hidden">
<pre class="break-words w-56 whitespace-break-spaces p-2 rounded-md mx-auto my-2 bg-gray-100">
@@ -289,7 +307,14 @@ export function Transfers(): VNode {
)}
</td>
<td class="hidden sm:table-cell px-3 py-3.5 text-sm text-gray-500">
- {item.payto_uri}
+ <a
+ href={routeToCaseById.url({
+ cid: hashPayto,
+ })}
+ class="text-indigo-600 hover:text-indigo-900 font-mono"
+ >
+ {item.payto_uri}
+ </a>
</td>
{/* <td class="hidden sm:table-cell px-3 py-3.5 text-sm text-gray-500 break-all min-w-md">
{item.subject}