Files
supabase/apps/studio/components/layouts/AuthLayout/AuthEmailsLayout.tsx
T
Joshen Lim 78fab83aee Chore/disable authentication segments (#38029)
* Add flags for policies, third party auth, and manual linking + providers in sign in page

* Add flag for rate limitm page

* Add UnknownInterface components

* Update comment

* Flip flags to true

* Add flag for sign in providers page
2025-08-20 19:34:41 +08:00

40 lines
1.0 KiB
TypeScript

import { PropsWithChildren } from 'react'
import { useParams } from 'common'
import { PageLayout } from 'components/layouts/PageLayout/PageLayout'
import { UnknownInterface } from 'components/ui/UnknownInterface'
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
import AuthLayout from './AuthLayout'
export const AuthEmailsLayout = ({ children }: PropsWithChildren<{}>) => {
const { ref } = useParams()
const showEmails = useIsFeatureEnabled('authentication:emails')
const navItems = [
{
label: 'Templates',
href: `/project/${ref}/auth/templates`,
},
{
label: 'SMTP Settings',
href: `/project/${ref}/auth/smtp`,
},
]
return (
<AuthLayout>
{showEmails ? (
<PageLayout
title="Emails"
subtitle="Configure what emails your users receive and how they are sent"
navigationItems={navItems}
>
{children}
</PageLayout>
) : (
<UnknownInterface urlBack={`/project/${ref}/auth/users`} />
)}
</AuthLayout>
)
}