Files
Momento/memento-note/components/archive-client.tsx
Antigravity bd495be965
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 12s
feat: design system overhaul — sidebar, AI chats, settings, brainstorm, color cleanup
- Sidebar: dynamic brand-accent colors, brainstorm section restyled
- AI chat general: popup panel with expand/collapse, hides when contextual AI open
- AI chat contextual: tabs reordered (Actions first), X close button, height fix
- Settings: all tabs restyled, 6 new color presets (sage, terracotta, iron, etc.)
- Global color cleanup: emerald/orange hardcoded → brand-accent dynamic
- Brainstorm page: orange → brand-accent throughout
- PageEntry animation component added to key pages
- Floating AI button: bg-brand-accent instead of hardcoded black
- i18n: all 15 locales updated with new AI/billing keys
- Billing: freemium quota tracking, BYOK, stripe subscription scaffolding
- Admin: integrated into new design
- AGENTS.md + CLAUDE.md project rules added
2026-05-16 12:59:30 +00:00

52 lines
1.2 KiB
TypeScript

'use client'
import { useState, useCallback } from 'react'
import { PageEntry } from '@/components/page-entry'
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 (
<PageEntry>
<NotesEditorialView
notes={notes}
onOpen={handleOpen}
/>
</PageEntry>
)
}