2023-09-16 20:04:48 +00:00
|
|
|
/** @jsx h */
|
2023-10-22 09:11:17 +00:00
|
|
|
import { h, render } from "https://esm.sh/preact@10.17.1";
|
2024-01-01 17:28:10 +00:00
|
|
|
import { PrivateKey } from "../../libs/nostr.ts/key.ts";
|
|
|
|
import { InMemoryAccountContext, NostrKind } from "../../libs/nostr.ts/nostr.ts";
|
2023-09-16 20:04:48 +00:00
|
|
|
import { ProfileCard } from "./profile-card.tsx";
|
|
|
|
import { testEventBus } from "./_setup.test.ts";
|
|
|
|
|
|
|
|
const ctx = InMemoryAccountContext.New(PrivateKey.Generate());
|
|
|
|
|
|
|
|
render(
|
|
|
|
<div>
|
2023-10-22 09:11:17 +00:00
|
|
|
<ProfileCard
|
|
|
|
publicKey={ctx.publicKey}
|
|
|
|
profileData={{
|
|
|
|
about: "a nostr user",
|
|
|
|
name: "Mike",
|
|
|
|
}}
|
|
|
|
emit={testEventBus.emit}
|
|
|
|
/>
|
2023-09-16 20:04:48 +00:00
|
|
|
<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);
|
|
|
|
}
|