'use client'
import React from 'react'
import Link from 'next/link'
import { usePathname } from 'next/navigation'
import {
Shield, Download, FileCode, Layers, Smartphone, Lock,
ChevronDown, ChevronRight, Home, BookOpen,
Code2
} from 'lucide-react'
interface NavItem {
title: string
href: string
icon?: React.ReactNode
children?: NavItem[]
}
const navigation: NavItem[] = [
{
title: 'Uebersicht',
href: '/developers/sdk/consent',
icon: ,
},
{
title: 'Installation',
href: '/developers/sdk/consent/installation',
icon: ,
},
{
title: 'API Referenz',
href: '/developers/sdk/consent/api-reference',
icon: ,
},
{
title: 'Frameworks',
href: '/developers/sdk/consent/frameworks',
icon: ,
children: [
{ title: 'React', href: '/developers/sdk/consent/frameworks/react' },
{ title: 'Vue', href: '/developers/sdk/consent/frameworks/vue' },
{ title: 'Angular', href: '/developers/sdk/consent/frameworks/angular' },
],
},
{
title: 'Mobile SDKs',
href: '/developers/sdk/consent/mobile',
icon: ,
children: [
{ title: 'iOS (Swift)', href: '/developers/sdk/consent/mobile/ios' },
{ title: 'Android (Kotlin)', href: '/developers/sdk/consent/mobile/android' },
{ title: 'Flutter', href: '/developers/sdk/consent/mobile/flutter' },
],
},
{
title: 'Sicherheit',
href: '/developers/sdk/consent/security',
icon: ,
},
]
function NavLink({ item, depth = 0 }: { item: NavItem; depth?: number }) {
const pathname = usePathname()
const isActive = pathname === item.href
const isParentActive = item.children?.some((child) => pathname === child.href)
const [isOpen, setIsOpen] = React.useState(isActive || isParentActive)
const hasChildren = item.children && item.children.length > 0
return (
{item.icon && {item.icon}}
{item.title}
{hasChildren && (
)}
{hasChildren && isOpen && (
{item.children?.map((child) => (
))}
)}
)
}
export function SDKDocsSidebar() {
return (
)
}
export default SDKDocsSidebar