+ {/* Modal Header */}
+
+
+
+
Notiz teilen & Berechtigungen
+
+
+
+
+
+ Dokument: {selectedDoc.title || 'Unbenannte Notiz'}
+
+
+ {shareError && (
+
+ {shareError}
+
+ )}
+
+ {/* If current user is owner: can add shares and manage permissions */}
+ {selectedDoc.isOwner !== false ? (
+
+
+
+ {/* List of current shares */}
+
+
Aktuelle Freigaben ({docShares.length})
+ {docShares.length === 0 ? (
+
+ Diese Notiz ist bisher noch mit niemandem geteilt.
+
+ ) : (
+
+ {docShares.map((share) => (
+
+
+
+ {share.displayName || share.userEmail || share.userId}
+
+ {share.userEmail && share.displayName && (
+
{share.userEmail}
+ )}
+
+
+
+
+
+
+
+
+ ))}
+
+ )}
+
+
+ ) : (
+ /* If current user is a collaborator */
+
+
Geteilte Notiz
+
+ Besitzer: {selectedDoc.ownerName || 'Unbekannt'}
+
+
+ Deine Berechtigung:{' '}
+
+ {selectedDoc.permission === 'write' ? 'Schreibzugriff (Bearbeiten erlaubt)' : 'Nur Lesezugriff'}
+
+
+
+
+
+
+
+ )}
+
+
+
+
+