Files
supabase/apps/studio/components/interfaces/Integrations/Integration/IntegrationOverviewTab.tsx
Francesco SansalvadoreandJoshen Lim 7edbedcbec fix integration overview tab contents (#46179)
Restores proper content in new marketplace detail overview pages
compared to the legacy overview pages.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added Data API URL settings and a visible "Required extensions"
section across integration overviews.
* Unified install/manage UIs for webhooks, Stripe Sync, wrappers,
queues, and others; marketplace mode now shows marketplace-specific
overview content.

* **Style**
* Improved marketplace detail rail and filter-bar button styling;
refined list/link row visuals.

* **Refactor**
* Overview pages reorganized to branch on marketplace mode and extract
shared overview content for consistency.

* **Tests**
  * Stabilized integration overview test data for deterministic runs.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/supabase/supabase/pull/46179?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2026-05-25 09:08:38 +02:00

104 lines
2.8 KiB
TypeScript

import { useParams } from 'common'
import { PropsWithChildren, ReactNode } from 'react'
import { cn } from 'ui'
import { INTEGRATIONS } from '../Landing/Integrations.constants'
import { BuiltBySection } from './BuildBySection'
import { MarkdownContent } from './MarkdownContent'
import { RequiredExtensionsSection } from './RequiredExtensionsSection'
import { useDatabaseExtensionsQuery } from '@/data/database-extensions/database-extensions-query'
import { useSelectedProjectQuery } from '@/hooks/misc/useSelectedProject'
export interface IntegrationOverviewTabProps {
actions?: ReactNode
status?: string | ReactNode
alert?: ReactNode
hideRequiredExtensionsSection?: boolean
}
export const OverviewTabSharedContent = ({
integration,
hideRequiredExtensionsSection = false,
actions,
alert,
children,
}: PropsWithChildren<{
integration: any
hideRequiredExtensionsSection?: boolean
actions?: ReactNode
alert?: ReactNode
}>) => {
const { data: project } = useSelectedProjectQuery()
const { data: extensions } = useDatabaseExtensionsQuery({
projectRef: project?.ref,
connectionString: project?.connectionString,
})
if (!integration) {
return <div>Unsupported integration type</div>
}
const installableExtensions = (extensions ?? []).filter((ext) =>
(integration.requiredExtensions ?? []).includes(ext.name)
)
const hasToInstallExtensions = installableExtensions.some((x) => !x.installed_version)
return (
<>
{!!alert && <div className="px-10 max-w-4xl">{alert}</div>}
<MarkdownContent key={integration.id} integrationId={integration.id} />
<RequiredExtensionsSection
hide={hideRequiredExtensionsSection}
className="px-4 md:px-10 max-w-4xl"
/>
{!!actions && (
<div
aria-disabled={hasToInstallExtensions && !hideRequiredExtensionsSection}
className={cn(
'px-10 max-w-4xl',
hasToInstallExtensions &&
!hideRequiredExtensionsSection &&
'opacity-25 [&_button]:pointer-events-none'
)}
>
{actions}
</div>
)}
{children}
</>
)
}
export const IntegrationOverviewTab = ({
actions,
alert,
status,
children,
hideRequiredExtensionsSection = false,
}: PropsWithChildren<IntegrationOverviewTabProps>) => {
const { id } = useParams()
const integration = INTEGRATIONS.find((i) => i.id === id)
if (!integration) {
return <div>Unsupported integration type</div>
}
return (
<div className="flex flex-col gap-8 py-10">
<BuiltBySection integration={integration} status={status} />
<OverviewTabSharedContent
integration={integration}
hideRequiredExtensionsSection={hideRequiredExtensionsSection}
alert={alert}
actions={actions}
>
{children}
</OverviewTabSharedContent>
</div>
)
}