import { For, Show, createSignal } from "solid-js"; import type { Note } from "@/api/client"; import type { NoteFileSource } from "@/lib/note-source"; import { NoteCard } from "@/components/notes/note-card"; import { NoteReaderPanel } from "@/components/notes/note-reader-panel"; import { EmptyState } from "@/components/ui/empty-state"; export function NoteList(props: { notes: Note[]; /** Which note family these belong to — decides the file routes behind them. */ source: NoteFileSource; /** Hides edit/delete and the file controls when false. Defaults to true. */ canManage?: boolean; emptyTitle: string; emptyDescription?: string; /** Opens a note somewhere else (its own page) instead of the reader panel; also used for edit. */ onOpen?: (note: Note) => void; onUpdate: (id: string, values: { title: string; content: string }) => Promise; onDelete: (id: string) => Promise; }) { const [readingNote, setReadingNote] = createSignal(null); return ( <> 0} fallback={ } >
    {(note) => (
  • (props.onOpen ? props.onOpen(item) : setReadingNote(item))} onEdit={props.onOpen} onUpdate={props.onUpdate} onDelete={props.onDelete} />
  • )}
{ if (!open) setReadingNote(null); }} /> ); }