2023-06-30 14:05:57 +00:00
|
|
|
/** @jsx h */
|
2023-09-06 16:29:27 +00:00
|
|
|
import { h, render } from "https://esm.sh/preact@10.17.1";
|
2023-06-30 14:05:57 +00:00
|
|
|
import { Editor } from "./editor.tsx";
|
2023-09-11 15:27:38 +00:00
|
|
|
import { InMemoryAccountContext, NostrKind } from "../lib/nostr-ts/nostr.ts";
|
|
|
|
import { PrivateKey } from "../lib/nostr-ts/key.ts";
|
|
|
|
import { testEventBus } from "./_setup.test.ts";
|
2023-06-30 14:05:57 +00:00
|
|
|
|
2023-09-11 15:27:38 +00:00
|
|
|
const ctx = InMemoryAccountContext.New(PrivateKey.Generate());
|
2023-06-30 14:05:57 +00:00
|
|
|
|
|
|
|
let vdom = (
|
|
|
|
<Editor
|
|
|
|
placeholder="Message @xxx"
|
|
|
|
maxHeight="50vh"
|
2023-09-11 15:27:38 +00:00
|
|
|
eventEmitter={testEventBus}
|
2023-06-30 14:05:57 +00:00
|
|
|
model={{
|
|
|
|
files: [],
|
2023-09-11 15:27:38 +00:00
|
|
|
id: "",
|
|
|
|
tags: [],
|
|
|
|
target: {
|
|
|
|
kind: NostrKind.DIRECT_MESSAGE,
|
|
|
|
receiver: {
|
|
|
|
pubkey: ctx.publicKey,
|
|
|
|
},
|
|
|
|
},
|
2023-06-30 14:05:57 +00:00
|
|
|
text: "",
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
render(vdom, document.body);
|