'use client'
import React from 'react'
import Link from 'next/link'
import { usePathname } from 'next/navigation'
import { Book, Code, FileText, HelpCircle, Zap, Terminal, Database, Shield, ChevronRight, Clock } from 'lucide-react'
interface NavItem {
title: string
href: string
icon?: React.ReactNode
items?: NavItem[]
}
const navigation: NavItem[] = [
{
title: 'Getting Started',
href: '/developers/getting-started',
icon: ,
items: [
{ title: 'Quick Start', href: '/developers/getting-started' },
],
},
{
title: 'SDK Documentation',
href: '/developers/sdk',
icon: ,
items: [
{ title: 'Overview', href: '/developers/sdk' },
{ title: 'Installation', href: '/developers/sdk/installation' },
{ title: 'Configuration', href: '/developers/sdk/configuration' },
],
},
{
title: 'Consent SDK',
href: '/developers/sdk/consent',
icon: ,
items: [
{ title: 'Uebersicht', href: '/developers/sdk/consent' },
{ title: 'Installation', href: '/developers/sdk/consent/installation' },
{ title: 'API Referenz', href: '/developers/sdk/consent/api-reference' },
{ title: 'Frameworks', href: '/developers/sdk/consent/frameworks' },
{ title: 'Mobile SDKs', href: '/developers/sdk/consent/mobile' },
{ title: 'Sicherheit', href: '/developers/sdk/consent/security' },
],
},
{
title: 'API Reference',
href: '/developers/api',
icon: ,
items: [
{ title: 'Overview', href: '/developers/api' },
{ title: 'State API', href: '/developers/api/state' },
{ title: 'RAG Search API', href: '/developers/api/rag' },
{ title: 'Generation API', href: '/developers/api/generate' },
{ title: 'Export API', href: '/developers/api/export' },
],
},
{
title: 'Guides',
href: '/developers/guides',
icon: ,
items: [
{ title: 'Overview', href: '/developers/guides' },
{ title: 'Phase 1: Assessment', href: '/developers/guides/phase1' },
{ title: 'Phase 2: Dokumentation', href: '/developers/guides/phase2' },
],
},
{
title: 'Changelog',
href: '/developers/changelog',
icon: ,
items: [
{ title: 'Versionshistorie', href: '/developers/changelog' },
],
},
]
interface DevPortalLayoutProps {
children: React.ReactNode
title?: string
description?: string
}
export function DevPortalLayout({ children, title, description }: DevPortalLayoutProps) {
const pathname = usePathname()
return (
{/* Header */}
Developer Portal
|
AI Compliance SDK
{/* Sidebar */}
{/* Main Content */}
{(title || description) && (
{title && (
{title}
)}
{description && (
{description}
)}
)}
{children}
)
}
// Re-usable components for documentation
export function ApiEndpoint({
method,
path,
description,
}: {
method: 'GET' | 'POST' | 'PUT' | 'DELETE'
path: string
description: string
}) {
const methodColors = {
GET: 'bg-green-100 text-green-800',
POST: 'bg-blue-100 text-blue-800',
PUT: 'bg-yellow-100 text-yellow-800',
DELETE: 'bg-red-100 text-red-800',
}
return (
{method}
{path}
{description}
)
}
export function CodeBlock({
language,
children,
filename,
}: {
language: string
children: string
filename?: string
}) {
return (
{filename && (
{filename}
)}
{children}
)
}
export function ParameterTable({
parameters,
}: {
parameters: Array<{
name: string
type: string
required?: boolean
description: string
}>
}) {
return (
| Parameter |
Type |
Required |
Description |
{parameters.map((param) => (
{param.name}
|
{param.type}
|
{param.required ? (
Yes
) : (
No
)}
|
{param.description} |
))}
)
}
export function InfoBox({
type = 'info',
title,
children,
}: {
type?: 'info' | 'warning' | 'success' | 'error'
title?: string
children: React.ReactNode
}) {
const styles = {
info: 'bg-blue-50 border-blue-200 text-blue-800',
warning: 'bg-yellow-50 border-yellow-200 text-yellow-800',
success: 'bg-green-50 border-green-200 text-green-800',
error: 'bg-red-50 border-red-200 text-red-800',
}
const icons = {
info: ,
warning: ,
success: ,
error: ,
}
return (
{icons[type]}
{title &&
{title}
}
{children}
)
}