From c94c3d36ad99f1b9072b0b94356d79d419868a55 Mon Sep 17 00:00:00 2001 From: SJCoetz Date: Mon, 3 Aug 2026 01:13:17 +0200 Subject: [PATCH] ui: simplify Gmail delivery settings Co-Authored-By: Claude Co-authored-by: Orca --- components/forms/settings-forms.tsx | 72 ++++++++--------------------- 1 file changed, 19 insertions(+), 53 deletions(-) diff --git a/components/forms/settings-forms.tsx b/components/forms/settings-forms.tsx index 32afa4d9..38ccca54 100644 --- a/components/forms/settings-forms.tsx +++ b/components/forms/settings-forms.tsx @@ -16,7 +16,7 @@ import { DialogTitle, } from "@/components/ui/dialog"; import { Plus, Trash2 } from "lucide-react"; -import { addUser, deleteUser, sendTestEmail, updateEmailSettings, type ActionResult } from "@/actions/settings"; +import { addUser, deleteUser, sendTestEmail, type ActionResult } from "@/actions/settings"; import { updateDefaultPrice } from "@/actions/pricing"; import { toast } from "sonner"; import type { AppUser, FuelSettings } from "@/lib/types"; @@ -32,16 +32,6 @@ interface Props { export function SettingsForms({ currentUserId, settings, users }: Props) { const router = useRouter(); const [defaultPrice, setDefaultPrice] = useState(settings?.default_price_per_litre || 0); - const [emailState, emailAction, emailPending] = useActionState(updateEmailSettings, initial); - const emailFormRef = useRef(null); - - useEffect(() => { - if (emailState.ok) { - toast.success("Email settings saved"); - } else if (emailState.error) { - toast.error(emailState.error); - } - }, [emailState]); function onSaveDefault() { startTransition(async () => { @@ -56,7 +46,7 @@ export function SettingsForms({ currentUserId, settings, users }: Props) { } const [, startTransition] = useTransition(); - const [testEmail, setTestEmail] = useState(settings?.statement_from_email || ""); + const [testEmail, setTestEmail] = useState(""); function onSendTest() { if (!testEmail) { @@ -116,51 +106,27 @@ export function SettingsForms({ currentUserId, settings, users }: Props) { - Email settings - SMTP / Resend configuration for sending statements + Email delivery + Customer statements are sent through Gmail SMTP. -
- -
-
- - -
-
- - -
-
- - -
-
- - -
+ +
+

Configured sender

+

rjbulk01@gmail.com

+

+ Gmail credentials are managed by the deployment environment and are not stored in PocketBase. +

+
+
+
+ + setTestEmail(e.target.value)} />
-
-
- - setTestEmail(e.target.value)} /> -
- -
- -
-
- +