feat: update navigation config -- remove search link, add recordings
This commit is contained in:
@@ -1,26 +1,23 @@
|
|||||||
import {
|
import {
|
||||||
Headphones,
|
|
||||||
LayoutDashboard,
|
LayoutDashboard,
|
||||||
type LucideIcon,
|
|
||||||
MessageSquare,
|
MessageSquare,
|
||||||
Mic,
|
Mic,
|
||||||
Music,
|
Headphones,
|
||||||
Search,
|
|
||||||
Settings,
|
Settings,
|
||||||
|
type LucideIcon,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
|
|
||||||
export interface NavItem {
|
export interface NavItem {
|
||||||
href: string;
|
href: string;
|
||||||
label: string;
|
label: string;
|
||||||
icon: LucideIcon;
|
icon: LucideIcon;
|
||||||
/** The pathname prefix that indicates this item is active */
|
}
|
||||||
|
|
||||||
|
export interface NavItemWithMatch extends NavItem {
|
||||||
matchPrefix: string;
|
matchPrefix: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
export const navItems: NavItemWithMatch[] = [
|
||||||
* Primary navigation items shown in the sidebar.
|
|
||||||
*/
|
|
||||||
export const navItems: NavItem[] = [
|
|
||||||
{
|
{
|
||||||
href: "/dashboard",
|
href: "/dashboard",
|
||||||
label: "Dashboard",
|
label: "Dashboard",
|
||||||
@@ -39,24 +36,12 @@ export const navItems: NavItem[] = [
|
|||||||
icon: Mic,
|
icon: Mic,
|
||||||
matchPrefix: "/voice",
|
matchPrefix: "/voice",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
href: "/media",
|
|
||||||
label: "Media",
|
|
||||||
icon: Music,
|
|
||||||
matchPrefix: "/media",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
href: "/recordings",
|
href: "/recordings",
|
||||||
label: "Recordings",
|
label: "Recordings",
|
||||||
icon: Headphones,
|
icon: Headphones,
|
||||||
matchPrefix: "/recordings",
|
matchPrefix: "/recordings",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
href: "/analysis",
|
|
||||||
label: "Search",
|
|
||||||
icon: Search,
|
|
||||||
matchPrefix: "/analysis",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
href: "/settings",
|
href: "/settings",
|
||||||
label: "Settings",
|
label: "Settings",
|
||||||
@@ -65,16 +50,14 @@ export const navItems: NavItem[] = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
export const mobileNavItems: NavItemWithMatch[] = navItems.filter((item) =>
|
||||||
* Mobile bottom bar items (subset of primary nav).
|
["/dashboard", "/messages", "/voice", "/recordings"].includes(item.href),
|
||||||
*/
|
|
||||||
export const mobileNavItems: NavItem[] = navItems.filter((item) =>
|
|
||||||
["/dashboard", "/messages", "/voice", "/media"].includes(item.href),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
export type NavItemId = (typeof navItems)[number]["href"];
|
export function isActivePath(
|
||||||
|
pathname: string,
|
||||||
export function isActivePath(pathname: string, matchPrefix: string): boolean {
|
matchPrefix: string,
|
||||||
|
): boolean {
|
||||||
if (matchPrefix === "/dashboard") return pathname === "/dashboard";
|
if (matchPrefix === "/dashboard") return pathname === "/dashboard";
|
||||||
return pathname.startsWith(matchPrefix);
|
return pathname.startsWith(matchPrefix);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user