@@ -521,68 +720,18 @@ export function Sidebar({ className, user }: { className?: string; user?: any })
{t('sidebar.inbox')}
-
-
{
- const params = new URLSearchParams()
- params.set('shared', '1')
- params.set('forceList', '1')
- router.push(`/?${params.toString()}`)
- }}
- className={cn('sidebar-inbox-item', searchParams.get('shared') === '1' && pathname === '/' && 'active')}
- >
-
-
-
-
- {t('sidebar.sharedWithMe')}
-
-
-
-
{
- const params = new URLSearchParams()
- params.set('reminders', '1')
- params.set('forceList', '1')
- router.push(`/?${params.toString()}`)
- }}
- className={cn('sidebar-inbox-item', searchParams.get('reminders') === '1' && pathname === '/' && 'active')}
- >
-
-
-
-
- {t('sidebar.reminders')}
-
-
{/* Divider */}
@@ -593,69 +742,23 @@ export function Sidebar({ className, user }: { className?: string; user?: any })
onDrop={handleDrop}
onDragOver={(e) => e.preventDefault()}
>
- {rootNotebooks.map((notebook: Notebook) => {
- const isActive = currentNotebookId === notebook.id
- const notes = notebookNotes[notebook.id] || []
- const isDragging = draggedId === notebook.id
- const children = childNotebooks.get(notebook.id) || []
- const isChildActive = children.some(c => currentNotebookId === c.id)
- const isExpanded = isActive || isChildActive
- return (
-
- handleDragStart(e, notebook.id)}
- onDragOver={(e) => handleDragOver(e, notebook.id)}
- onDragEnd={handleDragEnd}
- >
- 0,
- }}
- isActive={isExpanded}
- notes={notes}
- activeNoteId={currentNoteId}
- onCarnetClick={() => handleCarnetClick(notebook.id)}
- onNoteClick={handleNoteClick}
- onAddSubNotebook={() => {
- setCreateParentId(notebook.id)
- setIsCreateDialogOpen(true)
- }}
- isDragging={isDragging}
- depth={0}
- >
- {children.map(child => {
- const childActive = currentNotebookId === child.id
- const childNotes = notebookNotes[child.id] || []
- return (
- handleCarnetClick(child.id)}
- onNoteClick={handleNoteClick}
- depth={1}
- />
- )
- })}
-
-
-
- )
- })}
+ {renderCarnetTree(undefined, 0)}
+
) : (
@@ -703,28 +806,60 @@ export function Sidebar({ className, user }: { className?: string; user?: any })