feat(layout-system basics): Added component-map, component-props, configloader and renderer.

Added vt-template for nav and poc example footer.
Added ste.medusa-starter.design.json.
Probable starting point (main)/layout.tsx refactored to use dynamic layout renderer instead of hardcoded template.
This commit is contained in:
2025-11-19 18:19:25 +01:00
parent b7c67b5834
commit 51d6ee2051
8 changed files with 367 additions and 21 deletions
+16
View File
@@ -0,0 +1,16 @@
import React from "react"
import { LayoutComponentNode, LayoutContext, componentMap } from "./component-map"
export interface DynamicLayoutRendererProps {
nodes: LayoutComponentNode[]
context: LayoutContext
}
export function DynamicLayoutRenderer({ nodes, context } : DynamicLayoutRendererProps) {
return nodes.map((entry, index) => {
const [key, value] = Object.entries(entry)[0] as [string, any]
const component = componentMap[key]
if (!component) return null
return <React.Fragment key={index}>{component.render(value, context)}</React.Fragment>
})
}