diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx new file mode 100644 index 0000000..cafdbf5 --- /dev/null +++ b/src/components/Footer.tsx @@ -0,0 +1,81 @@ +import { Link } from "react-router-dom"; +import { Button } from "@/components/ui/button"; +import { Input } from "@/components/ui/input"; +import { Globe, Facebook, Instagram, Twitter, Youtube, Send } from "lucide-react"; +import { toast } from "sonner"; +import { useSaasMutation } from "@/hooks/use-tygarun"; + +export default function Footer() { + const { mutate: subscribe, loading: subscribing } = useSaasMutation("email", "/send/newsletter-confirm"); + + const handleNewsletter = async (e: React.FormEvent) => { + e.preventDefault(); + const data = new FormData(e.currentTarget); + try { + await subscribe({ email: data.get("email") }); + toast.success("Subscribed! Travel deals incoming."); + e.currentTarget.reset(); + } catch (err) { + toast.error("Could not subscribe. Please try again."); + } + }; + + return ( + + ); +} \ No newline at end of file