Files
supabase/apps/studio/components/layouts/AuthLayout/AuthProvidersLayout.tsx
2026-04-01 10:22:37 +02:00

47 lines
1.3 KiB
TypeScript

import { useParams } from 'common'
import { PropsWithChildren } from 'react'
import AuthLayout from './AuthLayout'
import { PageLayout } from '@/components/layouts/PageLayout/PageLayout'
import { UnknownInterface } from '@/components/ui/UnknownInterface'
import { useIsFeatureEnabled } from '@/hooks/misc/useIsFeatureEnabled'
export const AuthProvidersLayout = ({ children }: PropsWithChildren<{}>) => {
const { ref } = useParams()
const { authenticationSignInProviders, authenticationThirdPartyAuth } = useIsFeatureEnabled([
'authentication:sign_in_providers',
'authentication:third_party_auth',
])
const navItems = [
{
label: 'Supabase Auth',
href: `/project/${ref}/auth/providers`,
},
...(authenticationThirdPartyAuth
? [
{
label: 'Third-Party Auth',
href: `/project/${ref}/auth/third-party`,
},
]
: []),
]
return (
<AuthLayout title="Sign In / Providers">
{authenticationSignInProviders ? (
<PageLayout
title="Sign In / Providers"
subtitle="Configure authentication providers and login methods for your users"
navigationItems={navItems}
>
{children}
</PageLayout>
) : (
<UnknownInterface urlBack={`/project/${ref}/auth/users`} />
)}
</AuthLayout>
)
}