Files
breakpilot-lehrer/website/app/admin/docs/helpers.ts
Benjamin Admin 0b37c5e692 [split-required] Split website + studio-v2 monoliths (Phase 3 continued)
Website (14 monoliths split):
- compliance/page.tsx (1,519 → 9), docs/audit (1,262 → 20)
- quality (1,231 → 16), alerts (1,203 → 10), docs (1,202 → 11)
- i18n.ts (1,173 → 8 language files)
- unity-bridge (1,094 → 12), backlog (1,087 → 6)
- training (1,066 → 8), rag (1,063 → 8)
- Deleted index_original.ts (4,899 LOC dead backup)

Studio-v2 (5 monoliths split):
- meet/page.tsx (1,481 → 9), messages (1,166 → 9)
- AlertsB2BContext.tsx (1,165 → 5 modules)
- alerts-b2b/page.tsx (1,019 → 6), korrektur/archiv (1,001 → 6)

All existing imports preserved. Zero new TypeScript errors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-24 17:52:36 +02:00

59 lines
2.7 KiB
TypeScript

/**
* Helper functions for Developer Documentation Page
*/
import type { ServiceNode } from './types'
export const getArchTypeColor = (type: ServiceNode['type']) => {
switch (type) {
case 'frontend': return { bg: 'bg-blue-500', border: 'border-blue-600', text: 'text-blue-800', light: 'bg-blue-50' }
case 'backend': return { bg: 'bg-green-500', border: 'border-green-600', text: 'text-green-800', light: 'bg-green-50' }
case 'database': return { bg: 'bg-purple-500', border: 'border-purple-600', text: 'text-purple-800', light: 'bg-purple-50' }
case 'cache': return { bg: 'bg-cyan-500', border: 'border-cyan-600', text: 'text-cyan-800', light: 'bg-cyan-50' }
case 'search': return { bg: 'bg-pink-500', border: 'border-pink-600', text: 'text-pink-800', light: 'bg-pink-50' }
case 'storage': return { bg: 'bg-orange-500', border: 'border-orange-600', text: 'text-orange-800', light: 'bg-orange-50' }
case 'security': return { bg: 'bg-red-500', border: 'border-red-600', text: 'text-red-800', light: 'bg-red-50' }
case 'communication': return { bg: 'bg-yellow-500', border: 'border-yellow-600', text: 'text-yellow-800', light: 'bg-yellow-50' }
case 'ai': return { bg: 'bg-violet-500', border: 'border-violet-600', text: 'text-violet-800', light: 'bg-violet-50' }
case 'erp': return { bg: 'bg-indigo-500', border: 'border-indigo-600', text: 'text-indigo-800', light: 'bg-indigo-50' }
default: return { bg: 'bg-gray-500', border: 'border-gray-600', text: 'text-gray-800', light: 'bg-gray-50' }
}
}
export const getArchTypeLabel = (type: ServiceNode['type']) => {
switch (type) {
case 'frontend': return 'Frontend'
case 'backend': return 'Backend'
case 'database': return 'Datenbank'
case 'cache': return 'Cache'
case 'search': return 'Suche'
case 'storage': return 'Speicher'
case 'security': return 'Sicherheit'
case 'communication': return 'Kommunikation'
case 'ai': return 'KI/LLM'
case 'erp': return 'ERP'
default: return type
}
}
export const getServiceTypeColor = (type: string) => {
switch (type) {
case 'frontend': return 'bg-blue-100 text-blue-800'
case 'backend': return 'bg-green-100 text-green-800'
case 'database': return 'bg-purple-100 text-purple-800'
case 'communication': return 'bg-orange-100 text-orange-800'
case 'infrastructure': return 'bg-slate-200 text-slate-700'
default: return 'bg-gray-100 text-gray-800'
}
}
export const getMethodColor = (method: string) => {
switch (method) {
case 'GET': return 'bg-emerald-100 text-emerald-700'
case 'POST': return 'bg-blue-100 text-blue-700'
case 'PUT': return 'bg-amber-100 text-amber-700'
case 'DELETE': return 'bg-red-100 text-red-700'
default: return 'bg-gray-100 text-gray-700'
}
}