Files
Momento/memento-note/app/(main)/agents/page.tsx
Antigravity 916fb78dfb
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m9s
feat: hierarchical notebook system - trash, selectors, breadcrumb, sidebar tree
- Schema: soft delete with trashedAt on Notebook model
- API: PATCH/GET notebooks support trashedAt filtering with cascade
- Sidebar: recursive tree rendering with collapse/expand, visual guides, hover actions
- HierarchicalNotebookSelector: portal-based dropdown with search, breadcrumbs, dropUp support
- AI chat: context selector with Toutes mes notes + notebook selector
- Agent detail: flat selects replaced with HierarchicalNotebookSelector
- Breadcrumb: notebook path display on home page
- Trash view: card grid with countdown, restore/permanent delete
- CSS: design tokens (ink, paper, blueprint, concrete, etc.)
- Types: parentId, trashedAt added to Notebook interface
2026-05-10 10:52:26 +00:00

29 lines
746 B
TypeScript

import { auth } from '@/auth'
import { redirect } from 'next/navigation'
import { prisma } from '@/lib/prisma'
import { getAgents } from '@/app/actions/agent-actions'
import { AgentsPageClient } from './agents-page-client'
export default async function AgentsPage() {
const session = await auth()
if (!session?.user?.id) redirect('/login')
const userId = session.user.id
const [agents, notebooks] = await Promise.all([
getAgents(),
prisma.notebook.findMany({
where: { userId, trashedAt: null },
orderBy: { order: 'asc' },
select: { id: true, name: true, icon: true, parentId: true, trashedAt: true }
})
])
return (
<AgentsPageClient
agents={agents}
notebooks={notebooks}
/>
)
}