Files
supabase/apps/studio/components/layouts/AuthLayout/AuthEmailsLayout.tsx
Danny White 0c65581e6c chore(studio): split auth templates into subpages (#39831)
* basic subpages

* add template descriptions

* keep tabbed navigation alive

* revert active tab

* use bespoke layout for each template

* redirect non-feature preview users away

* template page improvements

* fix docs link

* add TemplateEditor

* fix errors

* better error for missing routes

* extract slugifyTitle function to ensure consistent slugs
2025-10-27 15:52:34 +11:00

41 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>
)
}