MCPcopy Create free account
hub / github.com/code-with-antonio/nodebase / AppSidebar

Function AppSidebar

src/components/app-sidebar.tsx:51–141  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49];
50
51export const AppSidebar = () => {
52 const router = useRouter();
53 const pathname = usePathname();
54 const { hasActiveSubscription, isLoading } = useHasActiveSubscription();
55
56 return (
57 <Sidebar collapsible="icon">
58 <SidebarHeader>
59 <SidebarMenuItem>
60 <SidebarMenuButton asChild className="gap-x-4 h-10 px-4">
61 <Link href="/" prefetch>
62 <Image src="/logos/logo.svg" alt="Nodebase" width={30} height={30} />
63 <span className="font-semibold text-sm">Nodebase</span>
64 </Link>
65 </SidebarMenuButton>
66 </SidebarMenuItem>
67 </SidebarHeader>
68 <SidebarContent>
69 {menuItems.map((group) => (
70 <SidebarGroup key={group.title}>
71 <SidebarGroupContent>
72 <SidebarMenu>
73 {group.items.map((item) => (
74 <SidebarMenuItem key={item.title}>
75 <SidebarMenuButton
76 tooltip={item.title}
77 isActive={
78 item.url === "/"
79 ? pathname === "/"
80 : pathname.startsWith(item.url)
81 }
82 asChild
83 className="gap-x-4 h-10 px-4"
84 >
85 <Link href={item.url} prefetch>
86 <item.icon className="size-4" />
87 <span>{item.title}</span>
88 </Link>
89 </SidebarMenuButton>
90 </SidebarMenuItem>
91 ))}
92 </SidebarMenu>
93 </SidebarGroupContent>
94 </SidebarGroup>
95 ))}
96 </SidebarContent>
97 <SidebarFooter>
98 <SidebarMenu>
99 {!hasActiveSubscription && !isLoading && (
100 <SidebarMenuItem>
101 <SidebarMenuButton
102 tooltip="Upgade to Pro"
103 className="gap-x-4 h-10 px-4"
104 onClick={() => authClient.checkout({ slug: "pro" })}
105 >
106 <StarIcon className="h-4 w-4" />
107 <span>Upgrade to Pro</span>
108 </SidebarMenuButton>

Callers

nothing calls this directly

Calls 1

useHasActiveSubscriptionFunction · 0.90

Tested by

no test coverage detected