import { Link, useMatchRoute } from '@tanstack/react-router' import { useParams } from 'common' import { PropsWithChildren } from 'react' import { NavMenu, NavMenuItem } from 'ui' import { PageHeader, PageHeaderDescription, PageHeaderMeta, PageHeaderSummary, PageHeaderTitle, } from 'ui-patterns/PageHeader' import { PageNav } from 'ui-patterns/PageNav' import AuthLayout from './AuthLayout' import { UnknownInterface } from '@/components/ui/UnknownInterface' import { useIsFeatureEnabled } from '@/hooks/misc/useIsFeatureEnabled' export const AuthProvidersLayout = ({ children }: PropsWithChildren<{}>) => { const { ref } = useParams() const matchRoute = useMatchRoute() const { authenticationSignInProviders, authenticationThirdPartyAuth } = useIsFeatureEnabled([ 'authentication:sign_in_providers', 'authentication:third_party_auth', ]) const navItems = [ { label: 'Supabase Auth', to: '/project/$ref/auth/providers' as const, }, ...(authenticationThirdPartyAuth ? [ { label: 'Third-Party Auth', to: '/project/$ref/auth/third-party' as const, }, ] : []), ] return ( {authenticationSignInProviders ? ( <> Sign In / Providers Configure authentication providers and login methods for your users {navItems.map((item) => ( {item.label} ))} {children} ) : ( )} ) }