mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 15:39:13 +00:00
## 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
21 lines
619 B
TypeScript
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'
|
|
}
|