Fix wrong code snippet

This commit is contained in:
Joseph Garrone
2024-06-20 04:28:12 +02:00
parent 44aec23251
commit 89b32dc7fc

View File

@ -190,6 +190,8 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
const userProfileFormFieldComponentName = "UserProfileFormFields"; const userProfileFormFieldComponentName = "UserProfileFormFields";
const componentName = componentBasename.replace(/.tsx$/, "");
console.log( console.log(
[ [
``, ``,
@ -207,10 +209,7 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
`// ...`, `// ...`,
``, ``,
chalk.green( chalk.green(
`+const ${componentBasename.replace( `+const ${componentName} = lazy(() => import("./pages/${componentName}"));`
/.tsx$/,
""
)} = lazy(() => import("./pages/${componentBasename}"));`
), ),
...[ ...[
``, ``,
@ -224,7 +223,7 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
` switch (kcContext.pageId) {`, ` switch (kcContext.pageId) {`,
` // ...`, ` // ...`,
`+ case "${pageIdOrComponent}": return (`, `+ case "${pageIdOrComponent}": return (`,
`+ <${componentBasename}`, `+ <${componentName}`,
`+ {...{ kcContext, i18n, classes }}`, `+ {...{ kcContext, i18n, classes }}`,
`+ Template={Template}`, `+ Template={Template}`,
`+ doUseDefaultCss={true}`, `+ doUseDefaultCss={true}`,