import { redirect } from "next/navigation"; import { MotionFade } from "@/components/motion-fade"; import { FlashMessage } from "@/components/root/flash-message"; import { RootDashboardShell } from "@/components/root/root-dashboard-shell"; import { SMTPSettingsForm } from "@/components/root/smtp-settings-form"; import { Button } from "@/components/ui/button"; import { clearAdminSessionCookie, isAdminAuthenticated } from "@/lib/admin-auth"; import { getMailSettingsFormValues } from "@/lib/app-config"; import { saveMailSettingsAction, sendTestEmailAction } from "./actions"; export const dynamic = "force-dynamic"; const copy = { title: "SMTP", subtitle: "Mailserver, Absender und Testempfaenger verwalten.", overview: "Uebersicht", maintenance: "Wartungsmodus", uiKit: "UI Kit", media: "Media", siteSettings: "Settings", smtp: "SMTP", contactProtection: "Contact Protection", portfolio: "Portfolio", logout: "Ausloggen", backToSite: "Zur Website", }; type RootSMTPPageProps = { searchParams?: { success?: string; error?: string; }; }; export default async function RootSMTPPage({ searchParams }: RootSMTPPageProps) { if (!isAdminAuthenticated()) { redirect("/root"); } async function logoutAction() { "use server"; clearAdminSessionCookie(); redirect("/root"); } const mailSettings = await getMailSettingsFormValues(); return ( )} >
{searchParams?.success ? ( ) : null} {searchParams?.error ? ( ) : null}
); }