This commit is contained in:
KNSONWS
2026-02-03 16:05:36 +01:00
parent 6af24d28e7
commit f2a3f47e07
7 changed files with 103 additions and 10 deletions

View File

@@ -6,6 +6,7 @@ import { Textarea } from "@/components/ui/textarea";
import { Label } from "@/components/ui/label";
import { ArrowLeft, Send } from "lucide-react";
import { useToast } from "@/hooks/use-toast";
import { createContactDocument } from "@/lib/appwrite";
const Contact = () => {
const { toast } = useToast();
@@ -30,16 +31,23 @@ const Contact = () => {
e.preventDefault();
setIsSubmitting(true);
// Simulate form submission
await new Promise((resolve) => setTimeout(resolve, 1000));
toast({
title: "Nachricht gesendet!",
description: "Wir melden uns innerhalb von 24 Stunden bei Ihnen.",
});
setFormData({ name: "", email: "", company: "", message: "" });
setIsSubmitting(false);
try {
await createContactDocument(formData);
toast({
title: "Nachricht gesendet!",
description: "Wir melden uns innerhalb von 24 Stunden bei Ihnen.",
});
setFormData({ name: "", email: "", company: "", message: "" });
} catch (err) {
const message = err instanceof Error ? err.message : "Speichern fehlgeschlagen.";
toast({
variant: "destructive",
title: "Fehler beim Senden",
description: message,
});
} finally {
setIsSubmitting(false);
}
};
return (