starkon
Version:
Complete Next.js boilerplate with authentication, i18n & CLI - Create production-ready apps instantly
22 lines (19 loc) • 455 B
text/typescript
export interface NavigationItem {
name: string
href: string
current?: boolean
icon?: React.ComponentType<React.SVGProps<SVGSVGElement>>
badge?: number
description?: string
external?: boolean
}
export interface DropdownSection {
title: string
items: NavigationItem[]
}
export const isActiveRoute = (pathname: string, href: string): boolean => {
if (href === '/') {
return pathname === '/'
}
return pathname.startsWith(href)
}