IntegrationOverviewTabWrapper.tsx 791 B

12345678910111213141516171819202122
  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. import { PropsWithChildren } from 'react'
  6. import { IntegrationOverviewTab, IntegrationOverviewTabProps } from './IntegrationOverviewTab'
  7. import { IntegrationOverviewTabV2 } from './IntegrationOverviewTabV2'
  8. import { useIsMarketplaceEnabled } from '@/components/interfaces/App/FeaturePreview/FeaturePreviewContext'
  9. export const IntegrationOverviewTabWrapper = (
  10. props: PropsWithChildren<IntegrationOverviewTabProps>
  11. ) => {
  12. const isMarketplaceEnabled = useIsMarketplaceEnabled()
  13. if (isMarketplaceEnabled) {
  14. return <IntegrationOverviewTabV2>{props.children}</IntegrationOverviewTabV2>
  15. } else {
  16. return <IntegrationOverviewTab {...props} />
  17. }
  18. }