import { Link, useRouterState } from '@tanstack/react-router' import type { LucideIcon } from 'lucide-react' import { HomeIcon, SettingsIcon, ShoppingCartIcon } from 'lucide-react' import { focusNewItemInput } from '@/components/items/create-item-form' import { NavUser } from '@/components/layout/nav-user' import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupLabel, SidebarHeader, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarRail, } from '@/components/ui/sidebar' type NavItem = { title: string to: string icon: LucideIcon } const NAV_ITEMS: NavItem[] = [ { title: 'Principal', to: '/', icon: HomeIcon }, { title: 'Listas', to: '/lists', icon: ShoppingCartIcon }, { title: 'Ajustes', to: '/settings', icon: SettingsIcon }, ] function isActive(pathname: string, to: string) { if (to === '/') return pathname === '/' return pathname === to || pathname.startsWith(`${to}/`) } export function AppSidebar() { const pathname = useRouterState({ select: (state) => state.location.pathname }) return ( focusNewItemInput(pathname)}>
SL
Superlist Listas compartidas
Plataforma {NAV_ITEMS.map((item) => ( focusNewItemInput(pathname) : undefined} > {item.title} ))}
) }