"use client" import { useNotification } from "@/app/context" import { UploadButton } from "@/components/files/upload-button" import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar" import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarHeader, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarRail, SidebarTrigger, useSidebar, } from "@/components/ui/sidebar" import { ClockArrowUp, FileText, Import, LayoutDashboard, Settings, Sparkles, Upload } from "lucide-react" import Link from "next/link" import { usePathname } from "next/navigation" import { useEffect } from "react" import { Blinker } from "./blinker" import { SidebarMenuItemWithHighlight } from "./sidebar-item" export function AppSidebar({ settings, unsortedFilesCount, }: { settings: Record unsortedFilesCount: number }) { const { open, setOpenMobile } = useSidebar() const pathname = usePathname() const { notification } = useNotification() // Hide sidebar on mobile when clicking an item useEffect(() => { setOpenMobile(false) }, [pathname, setOpenMobile]) return ( <> {open ? ( AI
{settings.app_title} Beta
) : ( AI )}
{open ? Upload : ""} Home Transactions {notification && notification.code === "sidebar.transactions" && notification.message && ( )} Unsorted {unsortedFilesCount > 0 && ( {unsortedFilesCount} )} {notification && notification.code === "sidebar.unsorted" && notification.message && } Settings Import from CSV Thank the author {!open && ( )}
) }