diff --git a/frontend/src/features/workspace/LinkModal.tsx b/frontend/src/features/workspace/LinkModal.tsx index 5c44b0d..2f31dcf 100644 --- a/frontend/src/features/workspace/LinkModal.tsx +++ b/frontend/src/features/workspace/LinkModal.tsx @@ -1,5 +1,14 @@ import React, { useState, useEffect, useMemo, useRef } from 'react'; -import { Link as LinkIcon, FileText, Globe, X, Search, ExternalLink, Loader2 } from 'lucide-react'; +import { + Link as LinkIcon, + FileText, + Globe, + X, + Search, + ExternalLink, + Loader2, + Plus, +} from 'lucide-react'; import { api } from '../../lib/api'; import { Document } from '../../lib/types'; @@ -117,7 +126,7 @@ export const LinkModal: React.FC = ({ }} >
- {/* Header */} + {/* Header - identical to UnifiedShareModal */}
@@ -134,96 +143,58 @@ export const LinkModal: React.FC = ({ type="button" onClick={onClose} className="p-1.5 text-muted hover:text-main rounded-btn hover:bg-panel transition-colors cursor-pointer" - title="Schließen (Esc)" + title="Schließen" >
- {/* Tab Switcher */} -
- - -
+ {/* Control Box - matching UnifiedShareModal form header */} +
+
+ Link-Typ: +
+ + +
+
- {/* Modal Body */} -
{tab === 'note' ? ( -
-
- - setSearch(e.target.value)} - placeholder="Notiz nach Titel oder Ordner filtern…" - className="input-field w-full text-xs pl-8 pr-3 py-2 text-main" - /> -
- - {loading ? ( -
- - Notizen werden geladen… -
- ) : ( -
- {filteredDocs.map((d) => ( - - ))} - - {filteredDocs.length === 0 && ( -
- {search - ? `Keine Notiz für "${search}" gefunden.` - : 'Keine Notizen im Workspace vorhanden.'} -
- )} -
- )} +
+ + setSearch(e.target.value)} + placeholder="Notiz suchen (Titel oder Ordner)…" + className="input-field bg-panel h-8 pl-8 pr-2.5 text-xs w-full text-main placeholder:text-muted" + />
) : ( -
+
@@ -248,30 +219,89 @@ export const LinkModal: React.FC = ({ value={webUrl} onChange={(e) => setWebUrl(e.target.value)} placeholder="https://example.com" - className="input-field w-full p-2 text-xs text-main" + className="input-field bg-panel h-8 px-2.5 text-xs w-full text-main placeholder:text-muted" />
-
+
)}
+ + {/* Note List Section (Matching Active Shares list in UnifiedShareModal) */} + {tab === 'note' && ( +
+
+ Verfügbare Notizen + + {filteredDocs.length} {filteredDocs.length === 1 ? 'Notiz' : 'Notizen'} + +
+ +
+ {loading ? ( +
+ + Notizen werden geladen… +
+ ) : filteredDocs.length === 0 ? ( +
+ + + {search + ? `Keine Notiz für "${search}" gefunden.` + : 'Keine Notizen im Workspace vorhanden.'} + +
+ ) : ( + filteredDocs.map((d) => ( +
handleSelectNote(d)} + className="flex items-center justify-between p-2.5 bg-canvas border border-border rounded-card hover:border-accent/60 transition-colors group cursor-pointer" + > +
+ {d.icon || '📝'} +
+
+ {d.title || 'Unbenannte Notiz'} +
+ {d.folderPath && ( +
+ 📁 {d.folderPath} +
+ )} +
+
+ +
+ )) + )} +
+
+ )}
);