feat: 我的资源分组新增周易议事外链菜单(连接bz9ai.top)
This commit is contained in:
@@ -27,22 +27,35 @@ export function Sidebar() {
|
|||||||
<div key={group} className="mb-4">
|
<div key={group} className="mb-4">
|
||||||
<div className="px-5 py-1 text-xs font-medium text-muted-foreground">{group}</div>
|
<div className="px-5 py-1 text-xs font-medium text-muted-foreground">{group}</div>
|
||||||
{items.map((item) => (
|
{items.map((item) => (
|
||||||
<NavLink
|
item.external ? (
|
||||||
key={item.path}
|
<a
|
||||||
to={item.path}
|
key={item.path}
|
||||||
end
|
href={item.path}
|
||||||
className={({ isActive }) =>
|
target="_blank"
|
||||||
cn(
|
rel="noopener noreferrer"
|
||||||
'flex items-center gap-3 px-5 py-2 text-sm transition-colors',
|
className="flex items-center gap-3 px-5 py-2 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"
|
||||||
isActive
|
>
|
||||||
? 'bg-primary/10 text-primary font-medium border-r-2 border-primary'
|
<item.icon className="h-4 w-4 shrink-0" />
|
||||||
: 'text-muted-foreground hover:bg-muted hover:text-foreground',
|
<span>{item.label}</span>
|
||||||
)
|
</a>
|
||||||
}
|
) : (
|
||||||
>
|
<NavLink
|
||||||
<item.icon className="h-4 w-4 shrink-0" />
|
key={item.path}
|
||||||
<span>{item.label}</span>
|
to={item.path}
|
||||||
</NavLink>
|
end
|
||||||
|
className={({ isActive }) =>
|
||||||
|
cn(
|
||||||
|
'flex items-center gap-3 px-5 py-2 text-sm transition-colors',
|
||||||
|
isActive
|
||||||
|
? 'bg-primary/10 text-primary font-medium border-r-2 border-primary'
|
||||||
|
: 'text-muted-foreground hover:bg-muted hover:text-foreground',
|
||||||
|
)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<item.icon className="h-4 w-4 shrink-0" />
|
||||||
|
<span>{item.label}</span>
|
||||||
|
</NavLink>
|
||||||
|
)
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import type { ComponentType } from 'react'
|
|||||||
import {
|
import {
|
||||||
LayoutDashboard, ClipboardList, Scale, TrendingUp, Heart, Users,
|
LayoutDashboard, ClipboardList, Scale, TrendingUp, Heart, Users,
|
||||||
BookOpen, History, User, Settings, ShieldCheck, FileText,
|
BookOpen, History, User, Settings, ShieldCheck, FileText,
|
||||||
BarChart3, Cpu, MessageSquare, UserCog, Briefcase, Sparkles,
|
BarChart3, Cpu, MessageSquare, UserCog, Briefcase, Sparkles, Compass,
|
||||||
} from 'lucide-react'
|
} from 'lucide-react'
|
||||||
|
|
||||||
export interface NavItem {
|
export interface NavItem {
|
||||||
@@ -23,6 +23,8 @@ export interface NavItem {
|
|||||||
tab?: boolean
|
tab?: boolean
|
||||||
/** 底部 Tab 显示标签(不填则用 label) */
|
/** 底部 Tab 显示标签(不填则用 label) */
|
||||||
tabLabel?: string
|
tabLabel?: string
|
||||||
|
/** 外部链接(新窗口打开,不走路由) */
|
||||||
|
external?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 用户端导航(老板) */
|
/** 用户端导航(老板) */
|
||||||
@@ -43,6 +45,7 @@ export const USER_NAV: NavItem[] = [
|
|||||||
{ path: '/knowledge', label: '知识库', icon: BookOpen, group: '我的资源' },
|
{ path: '/knowledge', label: '知识库', icon: BookOpen, group: '我的资源' },
|
||||||
{ path: '/history', label: '对话历史', icon: History, group: '我的资源' },
|
{ path: '/history', label: '对话历史', icon: History, group: '我的资源' },
|
||||||
{ path: '/profile', label: '我的画像', icon: User, group: '我的资源' },
|
{ path: '/profile', label: '我的画像', icon: User, group: '我的资源' },
|
||||||
|
{ path: 'https://bz9ai.top', label: '周易议事', icon: Compass, group: '我的资源', external: true },
|
||||||
// 系统
|
// 系统
|
||||||
{ path: '/settings', label: '设置', icon: Settings, group: '系统' },
|
{ path: '/settings', label: '设置', icon: Settings, group: '系统' },
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user