import CurvyRect from "@/components/shared/layout/curvy-rect"; import { cn } from "@/utils/cn"; import { ArrowUpRight } from "lucide-react"; interface Props { navigationItems: { label: string; items: { icon: React.ReactNode; label: string; description: string; href: string; target?: string; big?: boolean; ctas?: { label: string; href: string; target?: string }[]; sectionLabel?: string; iconClassName?: string; }[]; }[]; sideLabel: string; sideContent: React.ReactNode; sideItem: { icon: React.ReactNode; label: string; description: string; href: string; target?: string; }; } export default function HeaderDropdownContent({ navigationItems, sideLabel, sideContent, sideItem, }: Props) { return (
{navigationItems.map((item, index) => (
{/* Default section (items without sectionLabel) */}
{item.items .filter((it) => !it.sectionLabel && !it.big) .map((it) => ( ))} {item.items .filter((it) => !it.sectionLabel && it.big) .map((it) => ( ))}
{/* Additional sections within the same column */} {Array.from( new Set( item.items .map((it) => it.sectionLabel) .filter(Boolean) as string[], ), ).map((section) => (
{/* */}
{item.items .filter((it) => it.sectionLabel === section && !it.big) .map((it) => ( ))} {item.items .filter((it) => it.sectionLabel === section && it.big) .map((it) => ( ))}
))}
))}
{sideContent}
); } const GroupLabel = ({ label }: { label: string }) => { return (
{label}
); }; const Item = ({ item, }: { item: { icon: React.ReactNode; label: string; description: string; href: string; target?: string; iconClassName?: string; }; }) => { return (
{item.icon}
{item.label}
{item.description}
); }; const ItemBig = ({ item, }: { item: { icon: React.ReactNode; label: string; description: string; href: string; target?: string; ctas?: { label: string; href: string; target?: string }[]; iconClassName?: string; }; }) => { return (
{item.icon}
{item.label}
{item.description}
{item.ctas && item.ctas.length > 0 && (
{item.ctas.map((cta) => ( {cta.label} ))}
)}
); };