import { TalerError, TranslatedString, assertUnreachable } from "@gnu-taler/taler-util"; import { ErrorLoading, Loading, useTranslationContext } from "@gnu-taler/web-util/browser"; import { VNode, h } from "preact"; import { useState } from "preact/hooks"; import { createNewForm } from "../handlers/forms.js"; import { useCases } from "../hooks/useCases.js"; import { Pages } from "../pages.js"; import { AmlExchangeBackend } from "../types.js"; import { Officer } from "./Officer.js"; import { amlStateConverter } from "./ShowConsolidated.js"; export function Cases() { const { i18n } = useTranslationContext(); const form = createNewForm<{ state: AmlExchangeBackend.AmlState }>(); const initial = AmlExchangeBackend.AmlState.pending; const [stateFilter, setStateFilter] = useState(initial); const list = useCases(stateFilter); if (!list) { return } if (list instanceof TalerError) { return } if (list.data.type === "fail") { switch (list.data.case) { case "unauthorized": return case "officer-not-found": return case "officer-disabled": return default: assertUnreachable(list.data) } } const { records } = list.data.body return (

Cases

A list of all the account with the status

{ setStateFilter(v.state ?? initial); }} onSubmit={(v) => { }} >
{!records.length ? (
empty result
) : (
{records.map((r) => { return ( ); })}
Account Id Status Threshold
{((state: AmlExchangeBackend.AmlState): VNode => { switch (state) { case AmlExchangeBackend.AmlState.normal: { return ( Normal ); } case AmlExchangeBackend.AmlState.pending: { return ( Pending ); } case AmlExchangeBackend.AmlState.frozen: { return ( Frozen ); } } })(r.current_state)} {r.threshold}
)}
); } export const PeopleIcon = () => export const HomeIcon = () => export const ChevronRightIcon = () => export const ArrowRightIcon = () => function Pagination() { return ( ); }