Files
arjmand-pharmacy/components/layout/MegaMenu.tsx
T
Alireza HassaniandCursor cd2f9dfc9d Add Arjmand Pharmacy Next.js homepage.
Initial RTL storefront with header, slider, product sections, and local image assets.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-16 17:15:14 +03:30

42 lines
1.5 KiB
TypeScript

"use client";
import Link from "next/link";
import { categories } from "@/lib/data";
import { Placeholder } from "@/components/Placeholder";
export function MegaMenu({ open }: { open: boolean }) {
if (!open) return null;
return (
<div className="absolute top-full right-0 z-50 mt-2 w-[min(920px,calc(100vw-2rem))] rounded-2xl border border-line bg-white p-5 shadow-[0_16px_40px_rgba(0,38,133,0.12)]">
<div className="grid grid-cols-2 gap-5 md:grid-cols-4">
{categories.map((category) => (
<div key={category.id}>
<Link
href={category.href}
className="mb-3 flex items-center gap-2 text-[13.5px] font-semibold text-navy"
>
<span className="grid size-9 place-items-center overflow-hidden rounded-xl bg-sky">
<Placeholder src={category.image} className="size-full object-cover" />
</span>
{category.title}
</Link>
<ul className="space-y-1.5 pr-1">
{category.children.map((child) => (
<li key={child.title}>
<Link
href={child.href}
className="block rounded-lg px-2 py-1 text-[12.5px] text-muted transition hover:bg-sky hover:text-primary"
>
{child.title}
</Link>
</li>
))}
</ul>
</div>
))}
</div>
</div>
);
}