@@ -310,6 +310,7 @@ const generateApiPage = async (
310310 reactApi : ComponentReactApi ,
311311 sortingStrategies ?: SortingStrategiesType ,
312312 onlyJsonFile : boolean = false ,
313+ layoutConfigPath : string = '' ,
313314) => {
314315 const normalizedApiPathname = reactApi . apiPathname . replace ( / \\ / g, '/' ) ;
315316 /**
@@ -377,13 +378,18 @@ const generateApiPage = async (
377378 path . resolve ( apiPagesDirectory , `${ kebabCase ( reactApi . name ) } .js` ) ,
378379 `import * as React from 'react';
379380import { ApiPage } from '@mui/internal-core-docs/ApiPage';
380- import { mapApiPageTranslation } from '@mui/internal-core-docs/mapApiPageTranslations';
381+ import { mapApiPageTranslation } from '@mui/internal-core-docs/mapApiPageTranslations';${
382+ layoutConfigPath === ''
383+ ? ''
384+ : `
385+ import layoutConfig from '${ layoutConfigPath } ';`
386+ }
381387import translation from '${ importTranslationPagesDirectory } /${ kebabCase ( reactApi . name ) } /${ kebabCase ( reactApi . name ) } .json';
382388import jsonPageContent from './${ kebabCase ( reactApi . name ) } .json';
383389
384390export default function Page(props) {
385391 const { descriptions } = props;
386- return <ApiPage descriptions={descriptions} pageContent={jsonPageContent} />;
392+ return <ApiPage ${ layoutConfigPath === '' ? '' : '{...layoutConfig} ' } descriptions={descriptions} pageContent={jsonPageContent} />;
387393}
388394
389395export async function getStaticProps() {
@@ -913,6 +919,7 @@ export default async function generateComponentApi(
913919 reactApi ,
914920 projectSettings . sortingStrategies ,
915921 generateJsonFileOnly ,
922+ componentInfo . layoutConfigPath ,
916923 ) ;
917924
918925 if (
0 commit comments