1212import React , { ComponentType , ReactElement } from 'react' ;
1313import { Utils } from '../utils/Utils' ;
1414import { Properties , ClassNames } from '../constants' ;
15- import { ModelProps } from '../types/AEMModel' ;
15+ import { ModelProps , PageModel } from '../types/AEMModel' ;
1616import { ComponentMapping , MapTo } from '../core/ComponentMapping' ;
1717import { Config , MappedComponentProperties } from '../types/EditConfig' ;
1818
@@ -28,6 +28,7 @@ export type ContainerProps = {
2828 removeDefaultStyles ?: boolean ;
2929 config ?: Config < MappedComponentProperties > ;
3030 components ?: { [ key : string ] : ComponentType < MappedComponentProperties > } ;
31+ model ?: PageModel ;
3132} & ModelProps ;
3233
3334const getItemPath = ( cqPath : string , itemKey : string , isPage = false ) : string => {
@@ -81,6 +82,7 @@ export const Container = (props: ContainerProps): JSX.Element => {
8182 childPages,
8283 placeholderClassNames = '' ,
8384 components,
85+ model = { } ,
8486 } = props ;
8587
8688 if ( components && Object . keys ( components ) . length ) {
@@ -95,7 +97,7 @@ export const Container = (props: ContainerProps): JSX.Element => {
9597 } ) ||
9698 { } ;
9799
98- const childComponents = < ComponentList { ...props } /> ;
100+ const childComponents = < ComponentList { ...model } { ... props } /> ;
99101
100102 return isInEditor ? (
101103 < div className = { className || ClassNames . CONTAINER } { ...containerProps } >
0 commit comments