-
- {title && (
-
-
-
- )}
- {description && (
-
-
-
- )}
+
+
+ {title && (
+
+
+
+ )}
+ {description && (
+
+
+
+ )}
+
+
+
{!props.preview && (
@@ -158,3 +170,59 @@ export function PagePreview(props: {
);
}
+
+const Interactions = (props: { pageId: string; parentPageId?: string }) => {
+ const data = useContext(PostPageContext);
+ const document_uri = data?.uri;
+ if (!document_uri)
+ throw new Error("document_uri not available in PostPageContext");
+ let comments = data.comments_on_documents.filter(
+ (c) => (c.record as PubLeafletComment.Record)?.onPage === props.pageId,
+ ).length;
+ let quotes = data.document_mentions_in_bsky.filter((q) =>
+ q.link.includes(props.pageId),
+ ).length;
+
+ let { drawerOpen, drawer, pageId } = useInteractionState(document_uri);
+
+ return (
+
+ {quotes > 0 && (
+
+ )}
+ {comments > 0 && (
+
+ )}
+
+ );
+};