mirror of
https://github.com/BlowaterNostr/blowater.git
synced 2024-10-18 07:33:22 +00:00
35 lines
1012 B
TypeScript
35 lines
1012 B
TypeScript
/** @jsx h */
|
|
import { h, render } from "https://esm.sh/preact@10.17.1";
|
|
import { PrivateKey } from "../../libs/nostr.ts/key.ts";
|
|
import { InMemoryAccountContext, NostrKind } from "../../libs/nostr.ts/nostr.ts";
|
|
import { ProfileCard } from "./profile-card.tsx";
|
|
import { testEventBus } from "./_setup.test.ts";
|
|
|
|
const ctx = InMemoryAccountContext.New(PrivateKey.Generate());
|
|
|
|
render(
|
|
<div>
|
|
<ProfileCard
|
|
publicKey={ctx.publicKey}
|
|
profileData={{
|
|
about: "a nostr user",
|
|
name: "Mike",
|
|
}}
|
|
emit={testEventBus.emit}
|
|
/>
|
|
<ProfileCard publicKey={ctx.publicKey} profileData={undefined} emit={testEventBus.emit} />
|
|
<ProfileCard
|
|
publicKey={ctx.publicKey}
|
|
profileData={{
|
|
about: "I don't have a name",
|
|
}}
|
|
emit={testEventBus.emit}
|
|
/>
|
|
</div>,
|
|
document.body,
|
|
);
|
|
|
|
for await (const e of testEventBus.onChange()) {
|
|
console.log(e);
|
|
}
|