e.stopPropagation()} // Prevent closing when clicking inside
+ style={{
+ position: "fixed",
+ left: `${x}px`,
+ top: `${y}px`,
+ background: "rgba(255, 255, 255, 0.05)",
+ backdropFilter: "blur(12px)",
+ WebkitBackdropFilter: "blur(12px)",
+ border: "1px solid rgba(255, 255, 255, 0.25)",
+ borderRadius: "12px",
+ padding: "16px",
+ width: "320px",
+ zIndex: 1000,
+ pointerEvents: "auto",
+ boxShadow: "0 20px 25px -5px rgb(0 0 0 / 0.3), 0 8px 10px -6px rgb(0 0 0 / 0.3)",
+ }}
+ >
+ {node.type === "document" ? (
+ // Document popover
+
+ {/* Header */}
+
+
+
+
+ Document
+
+
+
+
+
+ {/* Sections */}
+
+ {/* Title */}
+
+
+ Title
+
+
+ {(node.data as any).title || "Untitled Document"}
+
+
+
+ {/* Summary - truncated to 2 lines */}
+ {(node.data as any).summary && (
+
+
+ Summary
+
+
+ {(node.data as any).summary}
+
+
+ )}
+
+ {/* Type */}
+
+
+ Type
+
+
+ {(node.data as any).type || "Document"}
+
+
+
+ {/* Memory Count */}
+
+
+ Memory Count
+
+
+ {(node.data as any).memoryEntries?.length || 0} memories
+
+
+
+ {/* URL */}
+ {((node.data as any).url || (node.data as any).customId) && (
+
+
+ URL
+
+
{
+ const doc = node.data as any
+ if (doc.type === "google_doc" && doc.customId) {
+ return `https://docs.google.com/document/d/${doc.customId}`
+ }
+ if (doc.type === "google_sheet" && doc.customId) {
+ return `https://docs.google.com/spreadsheets/d/${doc.customId}`
+ }
+ if (doc.type === "google_slide" && doc.customId) {
+ return `https://docs.google.com/presentation/d/${doc.customId}`
+ }
+ return doc.url ?? undefined
+ })()}
+ target="_blank"
+ rel="noopener noreferrer"
+ style={{
+ fontSize: "14px",
+ color: "rgb(129, 140, 248)",
+ textDecoration: "none",
+ display: "flex",
+ alignItems: "center",
+ gap: "4px",
+ transition: "color 0.2s",
+ }}
+ onMouseEnter={(e) => e.currentTarget.style.color = "rgb(165, 180, 252)"}
+ onMouseLeave={(e) => e.currentTarget.style.color = "rgb(129, 140, 248)"}
+ >
+
+ View Document
+
+
+ )}
+
+ {/* Footer with metadata */}
+
+
+
+ {new Date((node.data as any).createdAt).toLocaleDateString()}
+
+
+
+ {node.id}
+
+
+
+
+ ) : (
+ // Memory popover
+
+ {/* Header */}
+
+
+
+
+
+ {/* Sections */}
+
+ {/* Memory content */}
+
+
+ Memory
+
+
+ {(node.data as any).memory || (node.data as any).content || "No content"}
+
+ {(node.data as any).isForgotten && (
+
+ Forgotten
+
+ )}
+ {/* Expires (inline with memory if exists) */}
+ {(node.data as any).forgetAfter && (
+
+ Expires: {new Date((node.data as any).forgetAfter).toLocaleDateString()}
+ {(node.data as any).forgetReason && ` - ${(node.data as any).forgetReason}`}
+
+ )}
+
+
+ {/* Space */}
+
+
+ Space
+
+
+ {(node.data as any).spaceId || "Default"}
+
+
+
+ {/* Footer with metadata */}
+
+
+
+ {new Date((node.data as any).createdAt).toLocaleDateString()}
+
+
+
+ {node.id}
+
+
+
+
+ )}
+
+ >
+ )
+})