Add SMTP admin settings and contact form delivery

This commit is contained in:
MOH
2026-03-08 06:27:09 +01:00
parent 993a4673d8
commit 5ca4819bcb
28 changed files with 2087 additions and 55 deletions
+11 -3
View File
@@ -19,6 +19,7 @@ import { FormSaveButton } from "@/components/root/form-save-button";
import { SidebarMaintenanceControl } from "@/components/root/sidebar-maintenance-control";
import { ThemeToggle } from "@/components/theme-toggle";
import { Button } from "@/components/ui/button";
import { Separator } from "@/components/ui/separator";
import { getMaintenanceMode, getSiteSettingsMediaBindings } from "@/lib/app-config";
import { getLocalizedPath } from "@/lib/locale";
import { getRootNavigation } from "@/lib/root-navigation";
@@ -34,13 +35,16 @@ type RootDashboardCopy = {
portfolio: string;
media: string;
siteSettings: string;
smtp?: string;
contactProtection?: string;
logout: string;
backToSite: string;
};
type RootDashboardShellProps = {
copy: RootDashboardCopy;
active: "overview" | "maintenance" | "ui-kit" | "portfolio" | "media" | "site-settings";
active: "overview" | "maintenance" | "ui-kit" | "portfolio" | "media" | "site-settings" | "smtp";
smtpChild?: "settings" | "contact-protection";
portfolioChild?: "overview" | "projects" | "new-project" | "categories";
logoutAction: () => Promise<void>;
headerTitle: string;
@@ -58,6 +62,7 @@ type RootDashboardShellProps = {
export async function RootDashboardShell({
copy,
active,
smtpChild,
portfolioChild,
logoutAction,
headerTitle,
@@ -75,7 +80,7 @@ export async function RootDashboardShell({
getSiteSettingsMediaBindings(),
getMaintenanceMode(),
]);
const sidebarItems = getRootNavigation(copy, active, portfolioChild).filter(
const normalizedSidebarItems = getRootNavigation(copy, active, smtpChild, portfolioChild).filter(
(item) => item.href !== "/root/maintenance" && item.href !== "/root/ui-kit",
);
const headerIcon =
@@ -87,6 +92,8 @@ export async function RootDashboardShell({
? SwatchBook
: active === "site-settings"
? Globe2
: active === "smtp"
? ShieldAlert
: active === "media"
? ImageIcon
: portfolioChild === "categories"
@@ -111,7 +118,7 @@ export async function RootDashboardShell({
title={headerTitle}
description={headerDescription}
icon={headerIcon}
items={sidebarItems}
items={normalizedSidebarItems}
sidebarIconSrc={mediaBindings.favicon?.url}
sidebarTop={
<div className="space-y-2">
@@ -149,6 +156,7 @@ export async function RootDashboardShell({
<LogOut className="h-4 w-4" />
</Button>
</form>
<Separator />
</>
}
headerActions={