diff --git a/apps/webapp/src/components/Nav/main-nav.tsx b/apps/webapp/src/components/Nav/main-nav.tsx index 7732ae037..4fca3a47c 100644 --- a/apps/webapp/src/components/Nav/main-nav.tsx +++ b/apps/webapp/src/components/Nav/main-nav.tsx @@ -2,127 +2,74 @@ import { BookOpen, ExternalLink, KeyRound, Scroll, Settings2, Share2, SquareGantt } from "lucide-react"; import { usePathname } from "next/navigation"; -import { MouseEvent, ReactNode, useEffect, useState } from "react"; +import { cn } from "@/lib/utils"; +import { LucideIcon } from "lucide-react"; -interface MainNavProps { - onLinkClick: (name: string) => void; - className: string; -} - -interface NavLinkProps { - name: string; - content: ReactNode; - onClick: (name: string) => void; - isSelected: boolean; +interface NavItem { + title: string; + href: string; + icon: LucideIcon; isExternal?: boolean; - href?: string; } -export function NavLink({ - name, - content, - onClick, - isSelected, - isExternal = false, - href = '#' -}: NavLinkProps): JSX.Element { - const navItemClassName = `group flex gap-1 items-center rounded-md px-2 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground cursor-pointer ${isSelected ? 'bg-accent' : 'transparent' - } transition-colors`; - - function handleClick(e: MouseEvent): void { - if (!isExternal) { - e.preventDefault(); - onClick(name); - } +const items: NavItem[] = [ + { + title: "Connections", + href: "connections", + icon: Share2 + }, + { + title: "Events", + href: "events", + icon: Scroll + }, + { + title: "Configuration", + href: "configuration", + icon: Settings2 + }, + { + title: "API Keys", + href: "api-keys", + icon: KeyRound + }, + { + title: "Docs", + href: "https://docs.panora.dev/", + icon: BookOpen, + isExternal: true } - - return ( - - {content} - {isExternal && } - - ); -} +]; export function MainNav({ - onLinkClick, className, + onLinkClick, ...props -}: MainNavProps) { - const [selectedItem, setSelectedItem] = useState(""); +}: React.HTMLAttributes & { + onLinkClick: (page: string) => void; +}) { const pathname = usePathname(); - useEffect(() => { - setSelectedItem(pathname.substring(1)) - }, [pathname]) - return ( -