'use client' import { useState } from 'react' import type { Note } from '@/lib/types' import type { NotebookSchemaPayload, NotePropertyValues } from '@/lib/structured-views/types' import { formatPropertyDisplay } from '@/lib/structured-views/property-utils' import { getNoteDisplayTitle, getNoteFeedImage } from '@/lib/note-preview' import { useLanguage } from '@/lib/i18n' import { sanitizeIllustrationSvg } from '@/lib/sanitize-content' type NotesGalleryViewProps = { notes: Note[] schema: NotebookSchemaPayload noteValues: Record notebookColor?: string | null onOpen: (note: Note) => void } export function NotesGalleryView({ notes, schema, noteValues, notebookColor, onOpen, }: NotesGalleryViewProps) { const { t } = useLanguage() const untitled = t('notes.untitled') const previewProps = schema.properties.slice(0, 2) return (
{notes.map((note) => ( onOpen(note)} /> ))}
) } function GalleryCard({ note, title, image, notebookColor, previewProps, allProps, values, onOpen, }: { note: Note title: string image: string | null notebookColor?: string | null previewProps: NotebookSchemaPayload['properties'] allProps: NotebookSchemaPayload['properties'] values: NotePropertyValues onOpen: () => void }) { const [hover, setHover] = useState(false) const accent = notebookColor || '#A47148' return ( ) }