"use client"; import Link from "next/link"; import { FooterData } from "../../../../api/footerApi"; import footerData from "./footer.json"; interface FooterTopProps { data: FooterData; } const FooterTop = ({ data }: FooterTopProps) => { // Use passed data, fallback to static json if needed const effectiveData = data || footerData; // Ensure we always have a valid `top` object, even if API shape changes const top = effectiveData?.top || footerData.top; // If for some reason `top` is still missing, avoid rendering to prevent runtime errors if (!top) { return null; } return ( ); }; export default FooterTop;