"use client" import * as React from "react" import { Book, Command, Home, LucideIcon, Plus, User, Settings, Crown, LogOut } from "lucide-react" import { motion } from "framer-motion" import Link from "next/link" import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarHeader, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarRail, } from '@/components/ui/sidebar' import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar" import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu" import { useMapLocation, type LocationKey } from "@/hooks/use-map-location" import { ThemeToggle } from "@/components/theme-toggle" import { useMapZoom } from "@/hooks/use-map-zoom" import { useUser } from "./user-context" import { Separator } from "@/components/ui/separator" import { cn } from "@/lib/utils" import { useRouter } from "next/navigation" interface MainNavItemProps { icon: LucideIcon label: string onClick?: () => void className?: string } const MainNavItem = React.forwardRef( ({ icon: Icon, label, onClick, className }, ref) => { return ( {label} ) } ) MainNavItem.displayName = "MainNavItem" interface MainNavProps { className?: string items: { icon: LucideIcon label: string onClick?: () => void }[] } const MainNav = React.forwardRef( ({ items, className }, ref) => { return (
{items.map((item) => ( ))}
) } ) MainNav.displayName = "MainNav" // User avatar component function UserAvatar() { const { user } = useUser() if (user) { return ( {user.name?.charAt(0)?.toUpperCase() || "U"}

{user.name}

{user.email}

Profile ⌘P {/* */} {/* Upgrade to Pro ⌘U */} {/* Billing ⌘B */} {/* */} {/* Help Center API Documentation */} Log out ⇧⌘Q
) } return ( ) } export function AppSidebar({ ...props }: React.ComponentProps) { const router = useRouter() const mainNavItems = [ // { // icon: Home, // label: "Home", // onClick: () => console.log("Navigate to home") // }, { icon: Book, label: "Blogs", onClick: () => router.push("/blog") }, // { // icon: Plus, // label: "New", // onClick: () => console.log("Create new project") // } ] return (
{/* User avatar - fixed at bottom */}
) } export function NavSecondary({ items, ...props }: { items: { title: string url: string icon: LucideIcon }[] } & React.ComponentPropsWithoutRef) { return ( {items.map((item) => ( {item.title} ))} ) }