Menu Config
Menus are configured in console/src/config/menu.ts.
Data Structure
interface MenuItem {
index: string // Route path
title: string // Display name
icon: LucideIcon // Icon (Lucide React)
userRoles?: string[] // System role filter (optional)
tenantRoles?: string[] // Org role filter (optional)
}
interface MenuGroup {
title: string // Group title
children: MenuItem[]
}
Example
export const menuConfig: MenuGroup[] = [
{
title: "Dashboard",
children: [
{ index: "/", title: "Overview", icon: LayoutDashboard },
],
},
{
title: "Organization",
children: [
{ index: "/subscription", title: "Subscription", icon: CreditCard },
{ index: "/credits", title: "Credits", icon: Coins },
{ index: "/invoices", title: "Invoices", icon: FileText },
{ index: "/org/settings", title: "Settings", icon: Settings },
],
},
{
title: "Management",
children: [
{ index: "/admin/users", title: "Users", icon: Users, userRoles: ["owner"] },
],
},
]
Role Filtering
| Config | Effect |
|---|---|
| Not set | Visible to everyone |
userRoles: ["owner"] | System admin only (users.role = owner) |
tenantRoles: ["owner"] | Org owner only (tenant_members.role = owner) |
| Both set | Must satisfy both |
Dynamic Filtering
Menus are also dynamically filtered based on website config:
subscription.enabled = false→ hide subscription menucredit.enabled = false→ hide credits menu- Both disabled → hide invoices menu
Icons
Uses Lucide React icon library. Import at the top of the file:
import { LayoutDashboard, Blocks, Users } from "lucide-react"