@@ -5,24 +5,31 @@ import type { Framework } from '~/libraries/types'
55
66// Helper to resolve different module shapes (named export vs default)
77function resolveModuleDefault ( mod : any , key : string ) : React . ComponentType < any > {
8- if ( ! mod ) return ( undefined as any )
8+ if ( ! mod ) return undefined as any
99 if ( mod [ key ] && typeof mod [ key ] === 'function' ) return mod [ key ]
1010 if ( mod . default ) {
11- if ( mod . default [ key ] && typeof mod . default [ key ] === 'function' ) return mod . default [ key ]
11+ if ( mod . default [ key ] && typeof mod . default [ key ] === 'function' )
12+ return mod . default [ key ]
1213 if ( typeof mod . default === 'function' ) return mod . default
1314 }
1415 if ( typeof mod === 'function' ) return mod
1516 return ( mod as any ) . default ?? ( mod as any )
1617}
1718
1819const Tabs = React . lazy < React . ComponentType < any > > ( ( ) =>
19- import ( './Tabs' ) . then ( ( mod ) => ( { default : resolveModuleDefault ( mod , 'Tabs' ) } ) ) ,
20+ import ( './Tabs' ) . then ( ( mod ) => ( {
21+ default : resolveModuleDefault ( mod , 'Tabs' ) ,
22+ } ) ) ,
2023)
2124const PackageManagerTabs = React . lazy < React . ComponentType < any > > ( ( ) =>
22- import ( './PackageManagerTabs' ) . then ( ( mod ) => ( { default : resolveModuleDefault ( mod , 'PackageManagerTabs' ) } ) ) ,
25+ import ( './PackageManagerTabs' ) . then ( ( mod ) => ( {
26+ default : resolveModuleDefault ( mod , 'PackageManagerTabs' ) ,
27+ } ) ) ,
2328)
2429const FileTabs = React . lazy < React . ComponentType < any > > ( ( ) =>
25- import ( './FileTabs' ) . then ( ( mod ) => ( { default : resolveModuleDefault ( mod , 'FileTabs' ) } ) ) ,
30+ import ( './FileTabs' ) . then ( ( mod ) => ( {
31+ default : resolveModuleDefault ( mod , 'FileTabs' ) ,
32+ } ) ) ,
2633)
2734
2835export function handleTabsComponent (
0 commit comments