mirror of
https://github.com/gromlab-ru/slm-design.git
synced 2026-08-22 15:30:16 +03:00
feat: add example
This commit is contained in:
@@ -0,0 +1 @@
|
||||
export { {{name.pascalCase}}PageEntry } from './{{name.kebabCase}}.entry'
|
||||
@@ -0,0 +1,23 @@
|
||||
import { ComponentRenderer } from 'infra/cms/component-renderer'
|
||||
import { digitalPlatformApi } from '@biocadless/digital-platform-api'
|
||||
import type { CmsPageEntryProps } from 'infra/cms/cms-page-entry-registry'
|
||||
|
||||
/**
|
||||
* Входная точка CMS-страницы {{name.pascalCase}}.
|
||||
*
|
||||
* Используется для:
|
||||
* - загрузки дерева CMS-компонентов страницы
|
||||
* - подключения страницы к dynamic CMS routing
|
||||
*/
|
||||
export const {{name.pascalCase}}PageEntry = async (props: CmsPageEntryProps) => {
|
||||
const { pageId } = props
|
||||
const components = await digitalPlatformApi.componentInstances.listV1({ pageId })
|
||||
|
||||
return (
|
||||
<>
|
||||
{components.map((component) => (
|
||||
<ComponentRenderer key={component.id} data={component} />
|
||||
))}
|
||||
</>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user