"use client"; /** * T-140 — "Related" panel: the pages that reference THIS page (backlinks). * * A read-only slide-over (mirrors CommentPanel's backdrop + right drawer) * listing `GET /pages/:id/backlinks` — the server scans `child_page` / * `linked_database` blocks + comment mentions, then drops every source the * caller cannot VIEW (fail-closed, no existence leak). Rows deep-link to the * source page in the SAME workspace (backlinks are workspace-scoped). * * The data lives in the `useBacklinks` query (30 s staleTime, mirroring the * API's ≤60 s version-keyed cache); the panel is a pure presenter so the * fetch/caching is owned by the page (testable without rendering a dialog). */ import { X, Link2, Inbox } from "lucide-react"; import Link from "next/link"; import type { BacklinkRef } from "@/lib/types"; interface RelatedPanelProps { pageId: string; workspaceSlug: string; open: boolean; onClose: () => void; refs: BacklinkRef[]; isLoading: boolean; isError: boolean; } export function RelatedPanel({ pageId, workspaceSlug, open, onClose, refs, isLoading, isError }: RelatedPanelProps) { if (!open) return null; return ( <> {/* Backdrop (a click closes the panel). */}
); }