import Link from "next/link"; import { buttonVariants } from "@/components/ui/button"; import { cn } from "@/lib/utils"; import { NAVIGATION_QUERY_RESULT } from "@/sanity.types"; type SanityLink = NonNullable[number]; const defaultNavLinks = [ { title: "Wedding Guides", href: "/blog" }, { title: "For Couples", href: "/services/private-consultant" }, { title: "For Professionals", href: "/services/b2b" }, { title: "About", href: "/about" }, { title: "Contact", href: "/contact" }, ]; export default function DesktopNav({ navigation, }: { navigation: NAVIGATION_QUERY_RESULT; }) { const sanityLinks = navigation[0]?.links; const processedSanityLinks = sanityLinks?.map((navItem) => { if ( navItem.title?.trim().toLowerCase() === "inquire now" || navItem.href === "/contact" ) { return { ...navItem, title: "Contact", href: "/contact", buttonVariant: undefined, }; } return navItem; }); const hasSanityLinks = processedSanityLinks && processedSanityLinks.length > 0; return (
{hasSanityLinks ? ( processedSanityLinks.map((navItem) => ( {navItem.title} )) ) : ( <> {defaultNavLinks.map((item) => ( {item.title} ))} )} {/* Strategic Partnership CTA */} Become a Partner
); }