mirror of
https://github.com/AnmolSaini16/mapcn
synced 2026-05-01 18:37:01 +02:00
feat: add blocks showcase and restructure app
This commit is contained in:
36
src/components/main-nav.tsx
Normal file
36
src/components/main-nav.tsx
Normal file
@@ -0,0 +1,36 @@
|
||||
"use client";
|
||||
|
||||
import Link from "next/link";
|
||||
|
||||
import { siteNavigation } from "@/lib/site-navigation";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
export function MainNav({ className, ...props }: React.ComponentProps<"nav">) {
|
||||
const navItems = siteNavigation
|
||||
.find((group) => group.title === "Pages")
|
||||
?.items.filter((item) => item.title !== "Home");
|
||||
|
||||
if (!navItems) return null;
|
||||
|
||||
return (
|
||||
<nav className={cn("items-center gap-1", className)} {...props}>
|
||||
{navItems.map((item) => (
|
||||
<Button
|
||||
key={item.href}
|
||||
variant="ghost"
|
||||
asChild
|
||||
size="sm"
|
||||
className="px-2.5"
|
||||
>
|
||||
<Link
|
||||
href={item.href}
|
||||
className="relative inline-flex items-center gap-1.5"
|
||||
>
|
||||
<span>{item.title}</span>
|
||||
</Link>
|
||||
</Button>
|
||||
))}
|
||||
</nav>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user