- RTL: force dir=rtl on LabelFilter, NotesViewToggle, LabelManagementDialog - i18n: add missing keys (notifications, privacy, edit/preview, AI translate/undo) - Settings pages: convert to Server Components (general, appearance) + loading skeleton - AI menu: add Translate option (10 languages) + Undo AI button in toolbar - Fix: saveInline uses REST API instead of Server Action → eliminates all implicit refreshes in list mode - Fix: NotesTabsView notes sync effect preserves selected note on content changes - Fix: auto-tag suggestions now filter already-assigned labels - Fix: color change in card view uses local state (no refresh) - Fix: nav links use <Link> for prefetching (Settings, Admin) - Fix: suppress duplicate label suggestions already on note - Route: add /api/ai/translate endpoint
44 lines
1.1 KiB
TypeScript
44 lines
1.1 KiB
TypeScript
'use client'
|
|
|
|
import dynamic from 'next/dynamic'
|
|
import { Note } from '@/lib/types'
|
|
import { NotesTabsView } from '@/components/notes-tabs-view'
|
|
|
|
const MasonryGridLazy = dynamic(
|
|
() => import('@/components/masonry-grid').then((m) => m.MasonryGrid),
|
|
{
|
|
ssr: false,
|
|
loading: () => (
|
|
<div
|
|
className="min-h-[200px] rounded-xl border border-dashed border-muted-foreground/20 bg-muted/30 animate-pulse"
|
|
aria-hidden
|
|
/>
|
|
),
|
|
}
|
|
)
|
|
|
|
export type NotesViewMode = 'masonry' | 'tabs'
|
|
|
|
interface NotesMainSectionProps {
|
|
notes: Note[]
|
|
viewMode: NotesViewMode
|
|
onEdit?: (note: Note, readOnly?: boolean) => void
|
|
currentNotebookId?: string | null
|
|
}
|
|
|
|
export function NotesMainSection({ notes, viewMode, onEdit, currentNotebookId }: NotesMainSectionProps) {
|
|
if (viewMode === 'tabs') {
|
|
return (
|
|
<div className="flex min-h-0 flex-1 flex-col" data-testid="notes-grid-tabs-wrap">
|
|
<NotesTabsView notes={notes} onEdit={onEdit} currentNotebookId={currentNotebookId} />
|
|
</div>
|
|
)
|
|
}
|
|
|
|
return (
|
|
<div data-testid="notes-grid">
|
|
<MasonryGridLazy notes={notes} onEdit={onEdit} />
|
|
</div>
|
|
)
|
|
}
|