2026-01-22 14:19:54 +08:00
|
|
|
"use client";
|
|
|
|
|
|
2026-03-03 21:32:01 +08:00
|
|
|
import { BotIcon, MessagesSquare } from "lucide-react";
|
2026-01-22 14:19:54 +08:00
|
|
|
import Link from "next/link";
|
|
|
|
|
import { usePathname } from "next/navigation";
|
|
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
SidebarGroup,
|
|
|
|
|
SidebarMenu,
|
|
|
|
|
SidebarMenuButton,
|
|
|
|
|
SidebarMenuItem,
|
|
|
|
|
} from "@/components/ui/sidebar";
|
|
|
|
|
import { useI18n } from "@/core/i18n/hooks";
|
|
|
|
|
|
|
|
|
|
export function WorkspaceNavChatList() {
|
|
|
|
|
const { t } = useI18n();
|
|
|
|
|
const pathname = usePathname();
|
|
|
|
|
return (
|
|
|
|
|
<SidebarGroup className="pt-1">
|
|
|
|
|
<SidebarMenu>
|
|
|
|
|
<SidebarMenuItem>
|
|
|
|
|
<SidebarMenuButton isActive={pathname === "/workspace/chats"} asChild>
|
|
|
|
|
<Link className="text-muted-foreground" href="/workspace/chats">
|
|
|
|
|
<MessagesSquare />
|
|
|
|
|
<span>{t.sidebar.chats}</span>
|
|
|
|
|
</Link>
|
|
|
|
|
</SidebarMenuButton>
|
|
|
|
|
</SidebarMenuItem>
|
2026-03-03 21:32:01 +08:00
|
|
|
<SidebarMenuItem>
|
|
|
|
|
<SidebarMenuButton
|
|
|
|
|
isActive={pathname.startsWith("/workspace/agents")}
|
|
|
|
|
asChild
|
|
|
|
|
>
|
|
|
|
|
<Link className="text-muted-foreground" href="/workspace/agents">
|
|
|
|
|
<BotIcon />
|
|
|
|
|
<span>{t.sidebar.agents}</span>
|
|
|
|
|
</Link>
|
|
|
|
|
</SidebarMenuButton>
|
|
|
|
|
</SidebarMenuItem>
|
2026-01-22 14:19:54 +08:00
|
|
|
</SidebarMenu>
|
|
|
|
|
</SidebarGroup>
|
|
|
|
|
);
|
|
|
|
|
}
|