refactor: simplify dashboard layout by removing unused navigation props and implementing a new DocumentsSidebar for better document management

This commit is contained in:
Anish Sarkar 2026-03-05 20:34:02 +05:30
parent 0cffa206ad
commit 936bd70682
11 changed files with 388 additions and 84 deletions

View file

@ -13,6 +13,7 @@ import { IconRail } from "../icon-rail";
import {
AllPrivateChatsSidebar,
AllSharedChatsSidebar,
DocumentsSidebar,
InboxSidebar,
MobileSidebar,
MobileSidebarTrigger,
@ -94,6 +95,10 @@ interface LayoutShellProps {
onOpenChange: (open: boolean) => void;
searchSpaceId: string;
};
documentsPanel?: {
open: boolean;
onOpenChange: (open: boolean) => void;
};
}
export function LayoutShell({
@ -133,6 +138,7 @@ export function LayoutShell({
isLoadingChats = false,
allSharedChatsPanel,
allPrivateChatsPanel,
documentsPanel,
}: LayoutShellProps) {
const isMobile = useIsMobile();
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
@ -211,6 +217,14 @@ export function LayoutShell({
/>
)}
{/* Mobile Documents Sidebar - slide-out panel */}
{documentsPanel && (
<DocumentsSidebar
open={documentsPanel.open}
onOpenChange={documentsPanel.onOpenChange}
/>
)}
{/* Mobile All Shared Chats - slide-out panel */}
{allSharedChatsPanel && (
<AllSharedChatsSidebar
@ -325,6 +339,14 @@ export function LayoutShell({
/>
)}
{/* Documents Sidebar - slide-out panel */}
{documentsPanel && (
<DocumentsSidebar
open={documentsPanel.open}
onOpenChange={documentsPanel.onOpenChange}
/>
)}
{/* All Shared Chats - slide-out panel */}
{allSharedChatsPanel && (
<AllSharedChatsSidebar