AuthEmailsLayout.tsx40 lines · main
1import { useParams } from 'common'
2import { PropsWithChildren } from 'react'
3
4import AuthLayout from './AuthLayout'
5import { PageLayout } from '@/components/layouts/PageLayout/PageLayout'
6import { UnknownInterface } from '@/components/ui/UnknownInterface'
7import { useIsFeatureEnabled } from '@/hooks/misc/useIsFeatureEnabled'
8
9export const AuthEmailsLayout = ({ children }: PropsWithChildren<{}>) => {
10 const { ref } = useParams()
11
12 const showEmails = useIsFeatureEnabled('authentication:emails')
13
14 const navItems = [
15 {
16 label: 'Templates',
17 href: `/project/${ref}/auth/templates`,
18 },
19 {
20 label: 'SMTP Settings',
21 href: `/project/${ref}/auth/smtp`,
22 },
23 ]
24
25 return (
26 <AuthLayout title="Emails">
27 {showEmails ? (
28 <PageLayout
29 title="Emails"
30 subtitle="Configure what emails your users receive and how they are sent"
31 navigationItems={navItems}
32 >
33 {children}
34 </PageLayout>
35 ) : (
36 <UnknownInterface urlBack={`/project/${ref}/auth/users`} />
37 )}
38 </AuthLayout>
39 )
40}