'use client'
/**
* AI Module Sidebar
*
* Kompakte Sidebar-Komponente für Cross-Navigation zwischen AI-Modulen.
* Zeigt den Datenfluss und ermöglicht schnelle Navigation.
*
* Features:
* - Desktop: Fixierte Sidebar rechts
* - Mobile: Floating Action Button mit Slide-In Drawer
*/
import Link from 'next/link'
import { useState, useEffect } from 'react'
import { AI_MODULES, DATA_FLOW_CONNECTIONS, type AIModuleLink } from '@/types/ai-modules'
export interface AIModuleSidebarProps {
/** ID des aktuell aktiven Moduls */
currentModule: 'magic-help' | 'ocr-labeling' | 'rag-pipeline' | 'rag'
/** Optional: Kompakter Modus (nur Icons) */
compact?: boolean
/** Optional: Zusätzliche CSS-Klassen */
className?: string
}
export interface AIModuleSidebarResponsiveProps extends AIModuleSidebarProps {
/** Position des FAB auf Mobile */
fabPosition?: 'bottom-right' | 'bottom-left'
}
// Icons für die Module
const ModuleIcon = ({ id }: { id: string }) => {
switch (id) {
case 'magic-help':
return (
)
case 'ocr-labeling':
return (
)
case 'rag-pipeline':
return (
)
case 'rag':
return (
)
default:
return null
}
}
// Pfeil-Icon für Datenfluss
const ArrowIcon = () => (
)
export function AIModuleSidebar({
currentModule,
compact = false,
className = '',
}: AIModuleSidebarProps) {
const [isExpanded, setIsExpanded] = useState(!compact)
return (
{/* Header */}
setIsExpanded(!isExpanded)}
>
KI-Daten-Pipeline
{/* Content */}
{isExpanded && (
{/* Module Links */}
{AI_MODULES.map((module) => (
{module.name}
{module.description}
{currentModule === module.id && (
)}
))}
{/* Datenfluss-Visualisierung */}
Datenfluss
✨⟷🏷️🔄🔍
{/* Quick Info zum aktuellen Modul */}
{currentModule === 'magic-help' && (
Testen und verbessern Sie die TrOCR-Handschrifterkennung
)}
{currentModule === 'ocr-labeling' && (
Erstellen Sie Ground Truth Daten für das OCR-Training
)}
{currentModule === 'rag-pipeline' && (
Indexieren Sie Dokumente für die semantische Suche
)}
{currentModule === 'rag' && (
Verwalten und durchsuchen Sie indexierte Dokumente
)}
)}
)
}
/**
* Kompakte Inline-Version für mobile Ansichten
*/
export function AIModuleNav({ currentModule }: { currentModule: string }) {
return (