import { useMemo } from 'react' import { CompositionSlot } from './CompositionSlot.jsx' import { resolveSteeringComposition } from './resolveSteeringComposition.js' import { getCompositionSurface } from './uiSlotRegistry.js' /** * Rendert alle Slots einer Composition-Surface. * @param {{ * surfaceKey: string, * scope?: 'portfolio' | 'initiative', * operatingContext?: object | null, * steeringSnapshot?: object | null, * capabilities?: Set | string[], * filterContext?: Record, * opsContext?: object | null, * slotClassName?: string, * wrapperClassName?: string, * }} props */ export function CompositionSurface({ surfaceKey, scope = 'initiative', operatingContext = null, steeringSnapshot = null, capabilities = new Set(), filterContext = {}, opsContext = null, slotClassName, wrapperClassName, }) { const composition = useMemo( () => resolveSteeringComposition({ surfaceKey, scope, operatingContext, steeringSnapshot, capabilities, filterContext, opsContext, }), [surfaceKey, scope, operatingContext, steeringSnapshot, capabilities, filterContext, opsContext], ) const surface = getCompositionSurface(surfaceKey) if (!surface) return null return (
{surface.slotKeys.map((slotKey) => ( ))}
) }