+
Keine Feature-Instanzen verfügbar.
+
+ Kontaktiere einen Administrator, um Zugriff zu erhalten.
+
+
+);
+
+// =============================================================================
+// MAIN COMPONENT
+// =============================================================================
+
+export const MandateNavigation: React.FC = () => {
+ const mandates = useMandates();
+ const { hasAnyInstance } = useFeatureStore();
+
+ // TODO: Aus Auth-Store holen
+ const isSysAdmin = false;
+
+ return (
+
+ {/* System-Bereich (immer sichtbar) */}
+
+
+ {/* Separator */}
+
+
+ {/* Mandanten & Features */}
+ {hasAnyInstance() ? (
+ mandates.map(mandate => (
+
+ ))
+ ) : (
+
+ )}
+
+ {/* Separator vor Admin */}
+ {isSysAdmin &&
}
+
+ {/* Admin-Bereich (nur für SysAdmin) */}
+
+
+ );
+};
+
+export default MandateNavigation;
diff --git a/src/components/Navigation/index.ts b/src/components/Navigation/index.ts
new file mode 100644
index 0000000..f0d25c6
--- /dev/null
+++ b/src/components/Navigation/index.ts
@@ -0,0 +1,5 @@
+/**
+ * Navigation Components Export
+ */
+
+export { MandateNavigation } from './MandateNavigation';
diff --git a/src/hooks/useCurrentInstance.ts b/src/hooks/useCurrentInstance.ts
new file mode 100644
index 0000000..1efd0d6
--- /dev/null
+++ b/src/hooks/useCurrentInstance.ts
@@ -0,0 +1,137 @@
+/**
+ * useCurrentInstance Hook
+ *
+ * Liest die aktuelle Feature-Instanz aus den URL-Parametern.
+ * Die URL-Struktur ist: /mandates/:mandateId/:featureCode/:instanceId/...
+ *
+ * Dieser Hook ist die zentrale Stelle um den aktuellen Arbeitskontext zu ermitteln.
+ */
+
+import { useParams } from 'react-router-dom';
+import { useFeatureStore } from '../stores/featureStore';
+import type { FeatureInstance, Mandate, MandateFeature } from '../types/mandate';
+
+// =============================================================================
+// URL PARAMETER TYPES
+// =============================================================================
+
+export interface FeatureRouteParams {
+ mandateId?: string;
+ featureCode?: string;
+ instanceId?: string;
+ '*'?: string; // Wildcard für Sub-Pfade
+}
+
+// =============================================================================
+// RETURN TYPES
+// =============================================================================
+
+export interface CurrentInstanceContext {
+ // Aus URL
+ mandateId: string | undefined;
+ featureCode: string | undefined;
+ instanceId: string | undefined;
+
+ // Aufgelöste Objekte
+ mandate: Mandate | undefined;
+ feature: MandateFeature | undefined;
+ instance: FeatureInstance | undefined;
+
+ // Hilfsfunktionen
+ isValid: boolean;
+ isLoading: boolean;
+}
+
+// =============================================================================
+// HOOKS
+// =============================================================================
+
+/**
+ * Haupthook für den aktuellen Instanz-Kontext
+ *
+ * Verwendung:
+ * ```tsx
+ * function ContractList() {
+ * const { instance, isValid } = useCurrentInstance();
+ *
+ * if (!isValid) {
+ * return