import { useState } from "react"; import { Link } from "react-router"; import { Typography } from "@/editor/theme/Typography"; export type FooterProps = { brand: string; tagline: string; columns: Array<{ title: string; links: Array<{ label: string; href: string }>; }>; social: Array<{ label: string; href: string }>; showNewsletter: "yes" | "no"; newsletterHeading: string; newsletterEndpoint: string; copyright: string; }; export function Footer({ brand, tagline, columns, social, showNewsletter, newsletterHeading, newsletterEndpoint, copyright, }: FooterProps) { const [email, setEmail] = useState(""); const [submitted, setSubmitted] = useState(false); const submit = async (e: React.FormEvent) => { e.preventDefault(); if (!email) return; if (newsletterEndpoint) { try { await fetch(newsletterEndpoint, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ email }), }); } catch {} } setSubmitted(true); }; return ( ); }