refactor: add interface each component to define props config in JSON file

This commit is contained in:
Nam Doan
2025-11-26 11:22:08 +07:00
parent 3e5a88f42d
commit 60700ee11e
7 changed files with 100 additions and 26 deletions
@@ -1,8 +1,13 @@
import { DynamicLayoutRenderer } from "vibentec/renderer"
import { LayoutComponentDefinition, LayoutContext } from "vibentec/component-map";
export default function BannerNav({ node: node, context }: { node: LayoutComponentDefinition; context: LayoutContext }) {
const props = node.config ?? {};
interface BannerNavProps {
left?: LayoutComponentDefinition[]
center?: LayoutComponentDefinition[]
right?: LayoutComponentDefinition[]
}
export default function BannerNav({ node, context }: { node: LayoutComponentDefinition; context: LayoutContext }) {
const props = node.config as BannerNavProps ?? {};
return (
<nav className="content-container txt-xsmall-plus text-ui-fg-subtle flex items-center justify-between w-full h-full text-small-regular">