Files
supabase/apps/studio/components/interfaces/Integrations/Landing/useIntegrationDetail.utils.ts
Joshen Lim 0b9e8bdea4 Joshenlim/fe 4882 make the new integrations UI the default (#52683)
## Context

Makes the one-click integrations feature preview the new default +
cleans up all the old integrations code that's no longer used with this
change

## To test
- [ ] Verify that the project integrations page is using the new UI
2026-11-04 14:26:01 +08:00

21 lines
619 B
TypeScript

import type { IntegrationDefinition } from './Integrations.constants'
export type InstallActionType = 'oauth' | 'add-wrapper' | 'installed' | 'install-sheet' | null
/**
* Returns which install action type to render for an integration.
*/
export function getInstallActionType({
integration,
isInstalled,
}: {
integration: IntegrationDefinition | undefined
isInstalled: boolean
}): InstallActionType {
if (!integration) return null
if (integration.type === 'oauth') return 'oauth'
if (integration.type === 'wrapper') return 'add-wrapper'
if (isInstalled) return 'installed'
return 'install-sheet'
}