diff --git a/bun.lockb b/bun.lockb
index bf5558d..0ba45c6 100755
Binary files a/bun.lockb and b/bun.lockb differ
diff --git a/components/KindCard/3745.tsx b/components/KindCard/3745.tsx
index bfe572a..45ac7bf 100644
--- a/components/KindCard/3745.tsx
+++ b/components/KindCard/3745.tsx
@@ -1,18 +1,119 @@
+"use client";
+import { useState, useEffect } from "react";
+import Link from "next/link";
import Container from "./components/Container";
import { CardTitle, CardDescription } from "@/components/ui/card";
import { type Event } from "nostr-tools";
+import { cn } from "@/lib/utils";
+import { useNDK } from "@/app/_providers/ndk";
+import { RiArrowRightLine, RiLockLine } from "react-icons/ri";
+import { decryptMessage } from "@/lib/nostr";
+import { NDKUser } from "@nostr-dev-kit/ndk";
-export default function Kind3745({ pubkey }: Event) {
+import { EventSchema } from "@/types";
+import KindCard from "@/components/KindCard";
+import Spinner from "../spinner";
+
+export default function Kind3745(props: Event) {
+ const { pubkey, content, id } = props;
+ const [error, setError] = useState("");
+ const [fetchingEvent, setFetchingEvent] = useState(false);
+ const [decryptedEvent, setDecryptedEvent] = useState();
+ const { ndk } = useNDK();
+ useEffect(() => {
+ if (ndk && !fetchingEvent && !decryptedEvent) {
+ void handleFetchEvent();
+ }
+ }, [ndk]);
+
+ async function handleFetchEvent() {
+ setFetchingEvent(true);
+ try {
+ const directMessageEvent = await ndk!.fetchEvent({
+ kinds: [4],
+ authors: [pubkey],
+ ["#e"]: [id],
+ });
+ if (directMessageEvent) {
+ await directMessageEvent.decrypt(
+ new NDKUser({ hexpubkey: pubkey }),
+ ndk?.signer,
+ );
+ const passphrase = directMessageEvent.content;
+ if (!passphrase) {
+ setError("Unable to parse event");
+ return;
+ }
+ const decrypedData = await decryptMessage(content, passphrase);
+ console.log("Decrypted", decrypedData);
+ const hiddenEvent = EventSchema.safeParse(
+ JSON.parse(decrypedData ?? ""),
+ );
+ if (hiddenEvent.success) {
+ setDecryptedEvent(hiddenEvent.data);
+ } else {
+ setError("Unable to parse event");
+ }
+ }
+ } catch (err) {
+ setError("Unable to parse event");
+ } finally {
+ setFetchingEvent(false);
+ }
+ }
+ if (decryptedEvent) {
+ return ;
+ }
return (
-
- The start of the Nostr revolution
-
-
- This is the summary of this artilce. Let's hope that it is a good
- article and that it will end up being worth reading. I don't want to
- waste my time on some random other stuff.
-
+
+
+
+ The start of the Nostr revolution
+
+
+ Here is some secret text. If you are reading this, that means you've
+ tried some sneaky css tricks to reveal what was hidden 🫣.
+ Unfourtunatly, CSS won't be able to help you here. In fact, I can't
+ even reveal this if I wanted to. Only the correct private key can
+ reveal it.
+
+