diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx new file mode 100644 index 0000000..210755a --- /dev/null +++ b/src/components/Footer.tsx @@ -0,0 +1,136 @@ +import { useState } from "react"; +import { toast } from "sonner"; +import { Link } from "react-router-dom"; +import { Button } from "@/components/ui/button"; +import { Input } from "@/components/ui/input"; +import { Separator } from "@/components/ui/separator"; +import { Twitter, Github, Linkedin, Rss, Mail } from "lucide-react"; +import { useSaasMutation } from "@/hooks/use-tygarun"; + +const categoryLinks = [ + { label: "Technology", to: "/category/technology" }, + { label: "Design", to: "/category/design" }, + { label: "Business", to: "/category/business" }, + { label: "Lifestyle", to: "/category/lifestyle" }, +]; + +const quickLinks = [ + { label: "About", to: "/" }, + { label: "Contact", to: "/" }, + { label: "Privacy Policy", to: "/" }, + { label: "Terms of Service", to: "/" }, + { label: "RSS Feed", to: "/" }, +]; + +export default function Footer() { + const [email, setEmail] = useState(""); + const [subscribed, setSubscribed] = useState(false); + const { mutate: subscribeNewsletter, loading: subscribing } = useSaasMutation("email", "/send/newsletter-confirm"); + + const handleSubscribe = async (e) => { + e.preventDefault(); + if (!email) return; + try { + await subscribeNewsletter({ email }); + setSubscribed(true); + toast.success("Subscribed! Check your inbox."); + } catch { + toast.error("Could not subscribe. Please try again."); + } + }; + + return ( + + ); +}