import { Check } from 'lucide-react'
import Image from 'next/image'
import { Badge, Button } from 'ui'
import { AWS_IDP_REGIONS } from './AwsRegionSelector'
import {
getIntegrationType,
getIntegrationTypeIcon,
getIntegrationTypeLabel,
INTEGRATION_TYPES,
} from './ThirdPartyAuthForm.utils'
import { ThirdPartyAuthIntegration } from '@/data/third-party-auth/integrations-query'
import { DOCS_URL } from '@/lib/constants'
interface IntegrationCardProps {
integration: ThirdPartyAuthIntegration
canUpdateConfig: boolean
onDelete: () => void
}
export const getIntegrationTypeDescription = (type: INTEGRATION_TYPES) => {
switch (type) {
case 'firebase':
return (
<>
Allow users to use Supabase with Firebase project. You'll need to setup RLS policies for
all tables that you want to access with a Firebase JWT token. Additionally, you'll need to
add custom code to set the authenticated role to all your present and future
users. You can read more in the{' '}
documentation
.
>
)
case 'auth0':
return (
<>
Allow users to use Supabase with Auth0 project. Additional setup may be required. You can
read more in the{' '}
documentation
.
>
)
case 'awsCognito':
return (
<>
Allow users to use Supabase with an Amazon Cognito. Additional setup may be required. You
can read more in the{' '}
documentation
.
>
)
case 'clerk':
return (
<>
Allow users to use Supabase with Clerk. Additional setup may be required. You can read
more in the{' '}
documentation
.
>
)
case 'workos':
return (
<>
Allow users to use Supabase with WorkOS. Additional setup may be required. You can read
more in the{' '}
documentation
.
>
)
case 'custom':
default:
return 'Custom'
}
}
export const IntegrationTypeContent = ({
type,
integration,
}: {
type: INTEGRATION_TYPES
integration: ThirdPartyAuthIntegration
}) => {
switch (type) {
case 'firebase': {
const projectName =
integration.oidc_issuer_url?.replace('https://securetoken.google.com/', '') || ''
return (