mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-07-07 14:08:47 +00:00
66 lines
1.7 KiB
TypeScript
66 lines
1.7 KiB
TypeScript
"use client"
|
|
|
|
import * as React from "react"
|
|
import Link from "next/link"
|
|
import { usePathname } from "next/navigation"
|
|
|
|
import { siteConfig } from "@/config/site"
|
|
import { cn } from "@/lib/utils"
|
|
import { Icons } from "@/components/icons"
|
|
|
|
export function MainNav() {
|
|
const pathname = usePathname()
|
|
|
|
return (
|
|
<div className="mr-4 hidden md:flex">
|
|
<Link href="/" className="mr-6 flex items-center space-x-2">
|
|
<Icons.logo className="h-6 w-6" />
|
|
<span className="hidden font-bold sm:inline-block">
|
|
{siteConfig.name}
|
|
</span>
|
|
</Link>
|
|
<nav className="flex items-center space-x-6 text-sm font-medium">
|
|
<Link
|
|
href="/docs"
|
|
className={cn(
|
|
"transition-colors hover:text-foreground/80",
|
|
pathname === "/docs" ? "text-foreground" : "text-foreground/60"
|
|
)}
|
|
>
|
|
Documentation
|
|
</Link>
|
|
<Link
|
|
href="/docs/components"
|
|
className={cn(
|
|
"transition-colors hover:text-foreground/80",
|
|
pathname?.startsWith("/docs/components")
|
|
? "text-foreground"
|
|
: "text-foreground/60"
|
|
)}
|
|
>
|
|
Components
|
|
</Link>
|
|
<Link
|
|
href="/examples"
|
|
className={cn(
|
|
"transition-colors hover:text-foreground/80",
|
|
pathname?.startsWith("/examples")
|
|
? "text-foreground"
|
|
: "text-foreground/60"
|
|
)}
|
|
>
|
|
Examples
|
|
</Link>
|
|
<Link
|
|
href={siteConfig.links.github}
|
|
className={cn(
|
|
"hidden text-foreground/60 transition-colors hover:text-foreground/80 lg:block"
|
|
)}
|
|
>
|
|
GitHub
|
|
</Link>
|
|
</nav>
|
|
</div>
|
|
)
|
|
}
|