@@ -21,17 +21,7 @@ import { GitHubLogo } from './GitHub-Mark';
2121import { Import } from './Import' ;
2222import { TableOfContent } from './TableOfContent' ;
2323
24- const Links = ( ) => {
25- //todo: context is not available anymore like this
26- // const docsContext = useContext(DocsContext);
27- return null ;
28- const docsContext = { } ;
29- const isChart = docsContext . componentStories ( ) . at ( 0 ) . id . startsWith ( 'charts-' ) ;
30-
31- // const filePath = docsContext.parameters.fileName.replace(/^\.\//, '');
32- // const folderPath = filePath.substr(0, filePath.lastIndexOf('/'));
33-
34- // const githubUrl = `https://github.com/SAP/ui5-webcomponents-react/tree/main/${folderPath}`;
24+ const Links = ( { isChart } : { isChart ?: boolean } ) => {
3525 const githubUrl = `https://github.com/SAP/ui5-webcomponents-react` ;
3626
3727 const packageName = `@ui5/webcomponents-react${ isChart ? '-charts' : '' } ` ;
@@ -60,11 +50,9 @@ interface InfoTableProps {
6050export const InfoTable = ( { of, since, subComponents, mergeSubComponents } : InfoTableProps ) => {
6151 const context = useOf < 'meta' > ( of ) ;
6252 const { csfFile, preparedMeta } = context ;
63- console . log ( context ) ;
6453 const moduleName = csfFile . meta . component . displayName ;
6554
6655 const wcSubComponents = useGetSubComponentsOfModule ( moduleName . replace ( 'V2' , '' ) , preparedMeta . tags ) ;
67- console . log ( moduleName ) ;
6856 const subComps = mergeSubComponents
6957 ? [ ...( subComponents ?? [ ] ) , ...( wcSubComponents ?? [ ] ) ]
7058 : ( subComponents ?? wcSubComponents ) ;
@@ -88,7 +76,7 @@ export const InfoTable = ({ of, since, subComponents, mergeSubComponents }: Info
8876 < Label > Usage</ Label >
8977 </ th >
9078 < td data-import-cell = { supportsClipboardApi } >
91- < Import componentName = { moduleName } componentId = { preparedMeta . componentId } />
79+ < Import moduleNames = { [ moduleName ] } componentId = { preparedMeta . componentId } />
9280 { supportsClipboardApi && (
9381 < Button
9482 design = { ButtonDesign . Transparent }
@@ -117,7 +105,7 @@ export const InfoTable = ({ of, since, subComponents, mergeSubComponents }: Info
117105 < Label > Subcomponents</ Label >
118106 </ th >
119107 < td data-import-cell = { supportsClipboardApi } >
120- < Import moduleNames = { subComps } />
108+ < Import moduleNames = { subComps } componentId = { preparedMeta . componentId } />
121109 { supportsClipboardApi && (
122110 < Button
123111 design = { ButtonDesign . Transparent }
@@ -143,7 +131,7 @@ export const DocsHeader = ({ of, since, subComponents, mergeSubComponents, isCha
143131 < Title />
144132 { experimental && < Label className = { classes . experimentalLabel } > experimental</ Label > }
145133 < span style = { { flexGrow : 1 } } />
146- < Links />
134+ < Links isChart = { isChart } />
147135 </ FlexBox >
148136 < Subtitle />
149137 < InfoTable of = { of } since = { since } subComponents = { subComponents } mergeSubComponents = { mergeSubComponents } />
0 commit comments