"use client"; import Link from "next/link"; import { NoProductFoundIcon } from "@/app/utils/svgs/noProductFoundIcon"; type CategoryNode = { id: string; name: string; slug?: string; children?: CategoryNode[]; }; interface MegaMenuDropdownProps { isOpen: boolean; categories: CategoryNode[]; categoriesLoading: boolean; onClose: () => void; onMouseEnter?: () => void; onMouseLeave?: () => void; } export default function MegaMenuDropdown({ isOpen, categories, categoriesLoading, onClose, onMouseEnter, onMouseLeave, }: MegaMenuDropdownProps) { // Show all 100 categories directly in navigation return (
{categoriesLoading ? (

Loading categories...

) : categories.length === 0 ? (
{NoProductFoundIcon}

No Categories Found

Categories will appear here when available.

) : (
{categories.map((category) => (
{category.name} {category.children?.length ? (
    {[...category.children] .sort((a, b) => a.name.localeCompare(b.name)) .map((child) => (
  • {child.name}
  • ))}
) : null}
))}
{/* All categories are shown directly */} {/* View All Products Link */}
View All Products
)}
); }