Projektarten: Bereich Services

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Sonnet 5.5 committed 2026-09-30 17:44:55 +00:00
1 parent 8185081921
commit 7e79dac6b4
5 files changed
+151

No files matched your search

+34
View File
@@ -0,0 +1,34 @@
// Aufbereitung der /api/admin/services-Antwort für die Seite "Services"
const STATUS_LABELS = { in_development: 'In Entwicklung' }
export function servicesCards(api) {
if (!api) return []
const groups = api.groups || {}
const featureDefs = api.features || {}
const cards = (api.kinds || []).map((k) => {
const projects = groups[k.key] || []
return {
key: k.key,
label: k.label,
description: k.description || '',
count: projects.length,
features: (k.features || []).map((f) => ({
label: featureDefs[f]?.label || f,
statusLabel: STATUS_LABELS[featureDefs[f]?.status] || '',
})),
projects,
}
})
const missing = groups.missing || []
if (missing.length) {
cards.push({
key: 'missing',
label: 'Art fehlt',
description: 'Diese Projekte sind noch keiner Art zugeordnet.',
count: missing.length,
features: [],
projects: missing,
})
}
return cards
}