'use client'
import { cn } from '@/utils/cn'
import { Folder, GitBranch, Home, Info, Rss, Tags } from 'lucide-react'
import Link from 'next/link'
import { usePathname } from 'next/navigation'
import { ExternalLink } from '../common/ExternalLink'
type NavItem = {
href: string
label: string
icon: React.ReactNode
isExternal?: boolean
}
const navItems: NavItem[] = [
{ href: '/', label: 'Home', icon: },
{ href: '/categories', label: 'Categories', icon: },
{ href: '/about', label: 'About', icon: },
{ href: '/tags', label: 'Tags', icon: },
{
href: '/feed.xml',
label: 'RSS Feed',
icon: ,
isExternal: true,
},
{
href: 'https://git.hangerthem.com/hangerthem/blog.hangerthem.com',
label: 'Source Code',
icon: ,
isExternal: true,
},
]
export function NavLinks() {
const pathname = usePathname()
const isActive = (href: string) => {
if (href === '/') {
return pathname === href
}
return pathname?.startsWith(href)
}
return navItems.map((item) => (
{item.isExternal ? (
{item.icon}
{item.label}
) : (
{item.icon}
{item.label}
)}
))
}