e.stopPropagation()}
onDoubleClick={(e) => e.stopPropagation()}
className="absolute top-4 left-4 z-10 flex flex-col gap-2 max-h-[42vh] overflow-y-auto pr-1"
>
{t('graphView.notebooks')}
{(selectedNotebookId || focusNodeId) && (
{selectedNotebookId && (
)}
{focusNodeId && (
)}
)}
{rawData.clusters.map(c => {
const isSelected = selectedNotebookId === c.id
const isAnySelected = selectedNotebookId !== null
const color = colorMap.get(c.id) ?? '#94a3b8'
return (
)
})}
)}
{/* Filtres de liens + seuil sémantique */}
{!loading && !error && rawData && (
e.stopPropagation()}
onDoubleClick={(e) => e.stopPropagation()}
className="absolute bottom-4 left-4 z-10 flex flex-col gap-2 max-w-[220px]"
>
{controlsOpen && (
{t('graphView.relationshipTypes')}
{([
['explicit_link', t('graphView.edgeTypes.explicitLink')],
['semantic_echo', t('graphView.edgeTypes.semanticEcho')],
['title_mention', t('graphView.edgeTypes.titleMention')],
['shared_label', t('graphView.edgeTypes.sharedLabel')],
['jaccard', t('graphView.edgeTypes.jaccard')],
] as [EdgeTypeKey, string][]).map(([key, label]) => (
))}
{edgeFilters.semantic_echo && (
)}
)}
)}
{/* Legend of relationship types (compact) */}
{!loading && !error && graphData.nodes.length > 0 && controlsOpen && (
e.stopPropagation()}
onDoubleClick={(e) => e.stopPropagation()}
className="absolute inset-y-0 right-0 w-80 backdrop-blur-md bg-white/95 dark:bg-stone-900/95 border-l border-border/40 flex flex-col shadow-[0_8px_30px_rgb(0,0,0,0.06)] z-20 transition-all duration-300"
>
{/* Header */}
{selectedNotebookName && (
)}
{selectedNode.title || {t('notes.untitled')}}
{/* Quick Metadata Info */}
{new Date(selectedNode.createdAt).toLocaleDateString(language === 'fa' ? 'fa-IR' : language, { day: '2-digit', month: 'short', year: 'numeric' })}
{t(selectedNode.degree === 1 ? 'graphView.connections' : 'graphView.connectionsPlural', { count: selectedNode.degree })}
{!previewLoading && notePreview && (
<>
{t('graphView.preview.words', { count: wordCount })}
{notePreview.updatedAt && (
{t('graphView.preview.updated')}{' '}
{new Date(notePreview.updatedAt).toLocaleDateString(language === 'fa' ? 'fa-IR' : language, { day: '2-digit', month: 'short', hour: '2-digit', minute: '2-digit' })}
)}
>
)}
{/* Scrollable Content */}
{previewLoading ? (
/* Sleek Skeleton Loader */
) : !notePreview || (!notePreview.content && (!notePreview.checkItems || notePreview.checkItems.length === 0)) ? (
{t('graphView.preview.emptyNote')}
) : (
<>
{/* Note Content Renderer */}
{notePreview.type === 'checklist' && notePreview.checkItems && notePreview.checkItems.length > 0 ? (
{}}
/>
) : notePreview.type === 'markdown' || notePreview.isMarkdown ? (
) : (
)}
{/* Refined Tags list */}
{Array.isArray(notePreview.labels) && notePreview.labels.length > 0 && (
{t('graphView.preview.tags')}
{notePreview.labels.map((label: string) => (
))}
)}
>
)}
{/* Premium Action Footer */}
)}