2026-07-26 15:34:08 +07:00
|
|
|
import {
|
|
|
|
|
LayoutDashboard,
|
|
|
|
|
MessageSquare,
|
|
|
|
|
Mic,
|
2026-07-28 08:10:09 +07:00
|
|
|
Headphones,
|
2026-07-27 21:54:31 +07:00
|
|
|
Settings,
|
2026-07-28 08:10:09 +07:00
|
|
|
type LucideIcon,
|
2026-07-26 15:34:08 +07:00
|
|
|
} from "lucide-react";
|
|
|
|
|
|
|
|
|
|
export interface NavItem {
|
|
|
|
|
href: string;
|
|
|
|
|
label: string;
|
|
|
|
|
icon: LucideIcon;
|
2026-07-28 08:10:09 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface NavItemWithMatch extends NavItem {
|
2026-07-26 15:34:08 +07:00
|
|
|
matchPrefix: string;
|
|
|
|
|
}
|
|
|
|
|
|
2026-07-28 08:10:09 +07:00
|
|
|
export const navItems: NavItemWithMatch[] = [
|
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",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
href: "/recordings",
|
|
|
|
|
label: "Recordings",
|
|
|
|
|
icon: Headphones,
|
|
|
|
|
matchPrefix: "/recordings",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
href: "/settings",
|
|
|
|
|
label: "Settings",
|
2026-07-27 21:54:31 +07:00
|
|
|
icon: Settings,
|
2026-07-26 15:34:08 +07:00
|
|
|
matchPrefix: "/settings",
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
2026-07-28 08:10:09 +07:00
|
|
|
export const mobileNavItems: NavItemWithMatch[] = navItems.filter((item) =>
|
|
|
|
|
["/dashboard", "/messages", "/voice", "/recordings"].includes(item.href),
|
2026-07-26 15:34:08 +07:00
|
|
|
);
|
|
|
|
|
|
2026-07-28 08:10:09 +07:00
|
|
|
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);
|
|
|
|
|
}
|