2026-07-26 15:34:08 +07:00
|
|
|
import {
|
2026-07-28 14:32:47 +07:00
|
|
|
Headphones,
|
2026-07-26 15:34:08 +07:00
|
|
|
LayoutDashboard,
|
2026-07-28 14:32:47 +07:00
|
|
|
type LucideIcon,
|
2026-07-26 15:34:08 +07:00
|
|
|
MessageSquare,
|
|
|
|
|
Mic,
|
2026-07-28 14:32:47 +07:00
|
|
|
Music,
|
|
|
|
|
Search,
|
2026-08-05 11:11:10 +07:00
|
|
|
Shield,
|
2026-07-26 15:34:08 +07:00
|
|
|
} from "lucide-react";
|
|
|
|
|
|
|
|
|
|
export interface NavItem {
|
|
|
|
|
href: string;
|
|
|
|
|
label: string;
|
|
|
|
|
icon: LucideIcon;
|
2026-07-28 14:32:47 +07:00
|
|
|
/** The pathname prefix that indicates this item is active */
|
2026-07-26 15:34:08 +07:00
|
|
|
matchPrefix: string;
|
|
|
|
|
}
|
|
|
|
|
|
2026-07-28 14:32:47 +07:00
|
|
|
/**
|
|
|
|
|
* Primary navigation items shown in the sidebar.
|
|
|
|
|
*/
|
|
|
|
|
export const navItems: NavItem[] = [
|
2026-07-26 15:34:08 +07:00
|
|
|
{
|
|
|
|
|
href: "/dashboard",
|
|
|
|
|
label: "Dashboard",
|
|
|
|
|
icon: LayoutDashboard,
|
|
|
|
|
matchPrefix: "/dashboard",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
href: "/messages",
|
|
|
|
|
label: "Messages",
|
|
|
|
|
icon: MessageSquare,
|
|
|
|
|
matchPrefix: "/messages",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
href: "/voice",
|
|
|
|
|
label: "Voice",
|
|
|
|
|
icon: Mic,
|
|
|
|
|
matchPrefix: "/voice",
|
|
|
|
|
},
|
2026-07-28 14:32:47 +07:00
|
|
|
{
|
|
|
|
|
href: "/media",
|
|
|
|
|
label: "Media",
|
|
|
|
|
icon: Music,
|
|
|
|
|
matchPrefix: "/media",
|
|
|
|
|
},
|
2026-07-26 15:34:08 +07:00
|
|
|
{
|
|
|
|
|
href: "/recordings",
|
|
|
|
|
label: "Recordings",
|
|
|
|
|
icon: Headphones,
|
|
|
|
|
matchPrefix: "/recordings",
|
|
|
|
|
},
|
2026-08-05 11:11:10 +07:00
|
|
|
{
|
|
|
|
|
href: "/moderation",
|
|
|
|
|
label: "Moderation",
|
|
|
|
|
icon: Shield,
|
|
|
|
|
matchPrefix: "/moderation",
|
|
|
|
|
},
|
2026-07-28 14:32:47 +07:00
|
|
|
{
|
|
|
|
|
href: "/analysis",
|
|
|
|
|
label: "Search",
|
|
|
|
|
icon: Search,
|
|
|
|
|
matchPrefix: "/analysis",
|
|
|
|
|
},
|
2026-07-26 15:34:08 +07:00
|
|
|
];
|
|
|
|
|
|
2026-07-28 14:32:47 +07:00
|
|
|
/**
|
|
|
|
|
* Mobile bottom bar items (subset of primary nav).
|
|
|
|
|
*/
|
|
|
|
|
export const mobileNavItems: NavItem[] = navItems.filter((item) =>
|
|
|
|
|
["/dashboard", "/messages", "/voice", "/media"].includes(item.href),
|
2026-07-26 15:34:08 +07:00
|
|
|
);
|
|
|
|
|
|
2026-07-28 14:32:47 +07:00
|
|
|
export type NavItemId = (typeof navItems)[number]["href"];
|
|
|
|
|
|
|
|
|
|
export function isActivePath(pathname: string, matchPrefix: string): boolean {
|
2026-07-27 21:54:31 +07:00
|
|
|
if (matchPrefix === "/dashboard") return pathname === "/dashboard";
|
|
|
|
|
return pathname.startsWith(matchPrefix);
|
|
|
|
|
}
|