diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx new file mode 100644 index 0000000..b06cbbf --- /dev/null +++ b/src/components/Footer.tsx @@ -0,0 +1,87 @@ +import { Link } from "react-router-dom"; +import { Heart, Mail, Facebook, Twitter, Instagram, Linkedin, Send, ShieldCheck } from "lucide-react"; +import { Button } from "@/components/ui/button"; +import { Input } from "@/components/ui/input"; +import { useSaasMutation } from "@/hooks/use-tygarun"; +import { toast } from "sonner"; + +export default function Footer() { + const { mutate: subscribe } = useSaasMutation("email", "/send/newsletter-confirm"); + + const handleNewsletter = async (e: React.FormEvent) => { + e.preventDefault(); + const form = e.currentTarget as HTMLFormElement; + const email = (new FormData(form).get("email") as string) || ""; + try { + await subscribe({ email }); + toast.success("Subscribed! You will receive our impact updates."); + form.reset(); + } catch { + toast.error("Could not subscribe. Please try again."); + } + }; + + return ( + + ); +} \ No newline at end of file