summaryrefslogtreecommitdiff
path: root/gui/src/components/post/wrappers/Nostr.tsx
blob: 7e963542a8bb740c24156cc97fdfc9bc6fb2a1cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import type { NostrPost } from "@/types/nostrill";
import Post from "../Post";
import useLocalState from "@/state/state";

export default NostrPost;
function NostrPost({ data }: { data: NostrPost }) {
  const { profiles } = useLocalState((s) => ({ profiles: s.profiles }));
  const profile = profiles.get(data.event.pubkey);

  return (
    <Post
      user={{ urbit: data.post.author }}
      poast={data.post}
      profile={profile}
    />
  );
}

export function NostrSnippet({ eventId, pubkey, relay, post }: NostrPost) {
  return <Post user={{ nostr: pubkey }} poast={post} />;
}