import { Bell, CalendarClock, Database, HardDrive, Settings } from "lucide-react"; import { Link, NavLink } from "react-router"; import { useState } from "react"; import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarHeader, SidebarMenu, SidebarMenuButton, SidebarMenuItem, useSidebar, } from "~/client/components/ui/sidebar"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "~/client/components/ui/tooltip"; import { HoverCard, HoverCardContent, HoverCardTrigger } from "~/client/components/ui/hover-card"; import { cn } from "~/client/lib/utils"; import { APP_VERSION, RCLONE_VERSION, RESTIC_VERSION, SHOUTRRR_VERSION } from "~/client/lib/version"; import { useUpdates } from "~/client/hooks/use-updates"; import { ReleaseNotesDialog } from "./release-notes-dialog"; const items = [ { title: "Volumes", url: "/volumes", icon: HardDrive, }, { title: "Repositories", url: "/repositories", icon: Database, }, { title: "Backups", url: "/backups", icon: CalendarClock, }, { title: "Notifications", url: "/notifications", icon: Bell, }, { title: "Settings", url: "/settings", icon: Settings, }, ]; export function AppSidebar() { const { state } = useSidebar(); const { updates, hasUpdate } = useUpdates(); const [showReleaseNotes, setShowReleaseNotes] = useState(false); const displayVersion = APP_VERSION.startsWith("v") || APP_VERSION === "dev" ? APP_VERSION : `v${APP_VERSION}`; const releaseUrl = APP_VERSION === "dev" ? "https://github.com/nicotsx/zerobyte" : `https://github.com/nicotsx/zerobyte/releases/tag/${displayVersion}`; return ( Zerobyte Logo Zerobyte {items.map((item) => ( {({ isActive }) => ( <> {item.title} )}

{item.title}

))}
{displayVersion}
Restic: {RESTIC_VERSION} Rclone: {RCLONE_VERSION} Shoutrrr: {SHOUTRRR_VERSION}
{hasUpdate && state !== "collapsed" && ( )}
); }