index.tsx20 lines · main
| 1 | import { useIsMarketplaceEnabled } from '@/components/interfaces/App/FeaturePreview/FeaturePreviewContext' |
| 2 | import LegacyIntegrationPage from '@/components/interfaces/Integrations/Integration/LegacyIntegrationPage' |
| 3 | import { MarketplaceDetail } from '@/components/interfaces/Integrations/Marketplace/MarketplaceDetail' |
| 4 | import { DefaultLayout } from '@/components/layouts/DefaultLayout' |
| 5 | import { ProjectIntegrationsLayoutDispatch } from '@/components/layouts/ProjectIntegrationsLayoutDispatch' |
| 6 | import type { NextPageWithLayout } from '@/types' |
| 7 | |
| 8 | const IntegrationPage: NextPageWithLayout = () => { |
| 9 | const isMarketplaceEnabled = useIsMarketplaceEnabled() |
| 10 | if (isMarketplaceEnabled) return <MarketplaceDetail /> |
| 11 | return <LegacyIntegrationPage /> |
| 12 | } |
| 13 | |
| 14 | IntegrationPage.getLayout = (page) => ( |
| 15 | <DefaultLayout> |
| 16 | <ProjectIntegrationsLayoutDispatch>{page}</ProjectIntegrationsLayoutDispatch> |
| 17 | </DefaultLayout> |
| 18 | ) |
| 19 | |
| 20 | export default IntegrationPage |