IntegrationOverviewTabWrapper.tsx22 lines · main
| 1 | /** |
| 2 | * [Joshen] This is just to dynamically render either the V1 or V2 Overview tab based |
| 3 | * on the marketplace feature flag |
| 4 | */ |
| 5 | |
| 6 | import { PropsWithChildren } from 'react' |
| 7 | |
| 8 | import { IntegrationOverviewTab, IntegrationOverviewTabProps } from './IntegrationOverviewTab' |
| 9 | import { IntegrationOverviewTabV2 } from './IntegrationOverviewTabV2' |
| 10 | import { useIsMarketplaceEnabled } from '@/components/interfaces/App/FeaturePreview/FeaturePreviewContext' |
| 11 | |
| 12 | export const IntegrationOverviewTabWrapper = ( |
| 13 | props: PropsWithChildren<IntegrationOverviewTabProps> |
| 14 | ) => { |
| 15 | const isMarketplaceEnabled = useIsMarketplaceEnabled() |
| 16 | |
| 17 | if (isMarketplaceEnabled) { |
| 18 | return <IntegrationOverviewTabV2>{props.children}</IntegrationOverviewTabV2> |
| 19 | } else { |
| 20 | return <IntegrationOverviewTab {...props} /> |
| 21 | } |
| 22 | } |