Created
January 30, 2025 13:20
-
-
Save sitefinitySDK/3768108aa15aab88b0cc69d4a4ea7bfd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { StaticSectionEntity } from './static-section.entity'; | |
import { ViewPropsBase } from '@progress/sitefinity-nextjs-sdk/widgets'; | |
import { RenderWidgetService } from '@progress/sitefinity-nextjs-sdk'; | |
export function TwoMixedView(props: ViewPropsBase<StaticSectionEntity>) { | |
const column = (containerName: string, className: string) => ( | |
<div className={className} data-sfcontainer={containerName}> | |
{props.widgetContext.model.Children.filter(x => x.PlaceHolder === containerName).map(x => { | |
return RenderWidgetService.createComponent(x, props.widgetContext.requestContext); | |
})} | |
</div> | |
); | |
return ( | |
<section {...props.attributes} className="row" > | |
{column('Column 1', 'col-4')} | |
{column('Column 2', 'col')} | |
</section> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment