Skip to content

Commit be707ad

Browse files
committed
docs: update API generator
1 parent 191b7ec commit be707ad

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/docs/build/api.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,18 @@ const options = {
2121
savePropValueAsString: true,
2222
}
2323

24+
const PRO_COMPONENTS = []
25+
2426
async function createMdx(file, filename, name, props) {
2527
if (typeof props === 'undefined') return
2628

29+
const pro = PRO_COMPONENTS.some((v) => file.includes(v))
30+
2731
let content = `
2832
\`\`\`jsx
29-
import { ${name} } from '@coreui/react'
33+
import { ${name} } from '@coreui/react${pro ? '-pro' : ''}'
3034
// or
31-
import ${name} from '@coreui/react/${file.replace('.tsx', '')}'
35+
import ${name} from '@coreui/react${pro ? '-pro' : ''}${file.replace('.tsx', '').replace(GLOBBY_OPTIONS.cwd, '')}'
3236
\`\`\`\n
3337
`
3438

0 commit comments

Comments
 (0)