diff --git a/packages/api-docs-builder/ApiBuilders/ComponentApiBuilder.ts b/packages/api-docs-builder/ApiBuilders/ComponentApiBuilder.ts index b3ba1c0006f5da..ebe0d2e8374a07 100644 --- a/packages/api-docs-builder/ApiBuilders/ComponentApiBuilder.ts +++ b/packages/api-docs-builder/ApiBuilders/ComponentApiBuilder.ts @@ -423,14 +423,14 @@ const generateApiPage = async ( path.resolve(apiPagesDirectory, `${kebabCase(reactApi.name)}.js`), `import * as React from 'react'; import ApiPage from 'docs/src/modules/components/ApiPage'; - import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; + import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations';${ + layoutConfigPath === '' + ? '' + : ` + import layoutConfig from '${layoutConfigPath}';` + } import jsonPageContent from './${kebabCase(reactApi.name)}.json'; -${ - layoutConfigPath === '' - ? '' - : ` import layoutConfig from '${layoutConfigPath}'; -` -} + export default function Page(props) { const { descriptions, pageContent } = props; return ;