2023-05-26 21:52:30 +02:00
|
|
|
import { Fragment, h } from "preact";
|
|
|
|
import { useOfficer } from "../hooks/useOfficer.js";
|
|
|
|
import { HandleAccountNotReady } from "./HandleAccountNotReady.js";
|
2023-05-19 01:32:20 +02:00
|
|
|
|
|
|
|
export function Officer() {
|
2023-05-26 21:52:30 +02:00
|
|
|
const officer = useOfficer();
|
|
|
|
if (officer.state !== "ready") {
|
|
|
|
return <HandleAccountNotReady officer={officer} />;
|
2023-05-19 18:26:47 +02:00
|
|
|
}
|
|
|
|
|
2023-05-19 01:32:20 +02:00
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<h1 class="my-2 text-3xl font-bold tracking-tight text-gray-900 ">
|
|
|
|
Public key
|
|
|
|
</h1>
|
2023-05-25 23:08:20 +02:00
|
|
|
<div class="max-w-xl text-base leading-7 text-gray-700 lg:max-w-lg">
|
2023-05-26 21:52:30 +02:00
|
|
|
<p class="mt-6 font-mono break-all">{officer.account.accountId}</p>
|
2023-05-19 01:32:20 +02:00
|
|
|
</div>
|
2023-05-25 23:08:20 +02:00
|
|
|
<p>
|
|
|
|
<a
|
|
|
|
href={`mailto:aml@exchange.taler.net?body=${encodeURIComponent(
|
2023-05-26 21:52:30 +02:00
|
|
|
`I want my AML account\n\n\nPubKey: ${officer.account.accountId}`,
|
2023-05-25 23:08:20 +02:00
|
|
|
)}`}
|
|
|
|
target="_blank"
|
|
|
|
rel="noreferrer"
|
|
|
|
class="m-4 block rounded-md w-fit border-0 px-3 py-2 text-center text-sm bg-indigo-700 text-white shadow-sm hover:bg-indigo-700"
|
|
|
|
>
|
|
|
|
Request account activation
|
|
|
|
</a>
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
onClick={() => {
|
2023-05-26 21:52:30 +02:00
|
|
|
officer.lock();
|
2023-05-25 23:08:20 +02:00
|
|
|
}}
|
|
|
|
class="m-4 block rounded-md border-0 bg-gray-200 px-3 py-2 text-center text-sm text-black shadow-sm "
|
|
|
|
>
|
|
|
|
Lock account
|
|
|
|
</button>
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
onClick={() => {
|
2023-05-26 21:52:30 +02:00
|
|
|
officer.forget();
|
2023-05-25 23:08:20 +02:00
|
|
|
}}
|
|
|
|
class="m-4 block rounded-md bg-red-600 px-3 py-2 text-center text-sm text-white shadow-sm hover:bg-red-500 "
|
|
|
|
>
|
|
|
|
Remove account
|
|
|
|
</button>
|
|
|
|
</p>
|
2023-05-19 01:32:20 +02:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|