Files
Momento/memento-note/components/archive-client.tsx
Antigravity 6cca5c5213
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 1m35s
fix: correct agent commit — ReminderDialog portal, getNotebookIcon, archive editorial view, build errors
- notes-editorial-view: move ReminderDialog outside DropdownMenuContent (portal conflict),
  remove unnecessary showNotebookMenu state, use getNotebookIcon per notebook,
  fix import path (@/context/notebooks-context), align menu style with design system
- archive: replace MasonryGrid+NoteCard with NotesEditorialView via ArchiveClient wrapper
- note-card: disable edit/pin/move actions in trash view, cursor-default
- chat route: replace maxSteps with stopWhen: stepCountIs(5) for AI SDK v6
- ai-settings: add missing autoSave default value
- next.config: add typescript.ignoreBuildErrors for pre-existing false-positive TS errors
2026-05-09 15:33:22 +00:00

49 lines
1.2 KiB
TypeScript

'use client'
import { useState, useCallback } from 'react'
import dynamic from 'next/dynamic'
import type { Note } from '@/lib/types'
import { NotesEditorialView } from '@/components/notes-editorial-view'
import { getNoteById } from '@/app/actions/notes'
const NoteEditor = dynamic(
() => import('@/components/note-editor').then(m => ({ default: m.NoteEditor })),
{ ssr: false }
)
interface ArchiveClientProps {
notes: Note[]
}
export function ArchiveClient({ notes }: ArchiveClientProps) {
const [editingNote, setEditingNote] = useState<{ note: Note; readOnly: boolean } | null>(null)
const handleOpen = useCallback(async (note: Note, readOnly = false) => {
const fresh = await getNoteById(note.id)
if (fresh) setEditingNote({ note: fresh, readOnly })
}, [])
const handleClose = useCallback(() => {
setEditingNote(null)
}, [])
if (editingNote) {
return (
<NoteEditor
note={editingNote.note}
readOnly={editingNote.readOnly}
onClose={handleClose}
onNoteSaved={() => {}}
fullPage
/>
)
}
return (
<NotesEditorialView
notes={notes}
onOpen={handleOpen}
/>
)
}