- {#each tags.slice(0, 3) as tag (tag)}
-
- {tag}
-
- {/each}
- {#if tags.length > 3}
-
- +{tags.length - 3}
-
+{#if note}
+
(e.key === 'Enter' || e.key === ' ') && (e.preventDefault(), onclick?.())}
+ >
+
+
+ {note.title || note.content.split('\n')[0] || 'Untitled'}
+
+
+ {#if note.pinned}
+
{/if}
+
- {/if}
-
+
-
-
- {formatRelativeTime(note.updatedAt)}
-
-
-
+
+ {#if note.content}
+
+ {#key note.content}
+
+ {/key}
+
+ {/if}
+
+ {#if note.tags.size > 0}
+ {@const tags = Array.from(note.tags)}
+
+ {#each tags.slice(0, 3) as tag (tag)}
+ {tag}
+ {/each}
+ {#if tags.length > 3}
+ +{tags.length - 3}
+ {/if}
+
+ {/if}
+
+
+
+ {getRelativeTime(note.updatedAt)}
+
+
+{/if}
+
diff --git a/src/routes/(app)/notes/NotesGrid.svelte b/src/routes/(app)/notes/NotesGrid.svelte
index 877fdc8..63a0475 100644
--- a/src/routes/(app)/notes/NotesGrid.svelte
+++ b/src/routes/(app)/notes/NotesGrid.svelte
@@ -1,68 +1,49 @@
-{#if loading}
-
+{#if noteService.loading}
{#each Array(6) as _}
-
-
-
+
{/each}
-{:else if notes.length === 0}
-
-
-
-
{emptyMessage}
-
- {#if emptyMessage === 'No notes found'}
- Create your first note to get started.
- {:else}
- {emptyMessage}
- {/if}
-
-
{:else}
-
-
- {#each notes as note (note.id)}
- onNoteClick?.(note)} />
- {/each}
-
+ {@const baseNotes = filter === 'pinned' ? noteService.pinnedNotes : filter === 'archived' ? noteService.archivedNotes : filter === 'trash' ? noteService.trashedNotes : noteService.activeNotes}
+ {@const notes = search.trim() ? noteService.searchNotes(search, baseNotes) : baseNotes}
+
+ {#if notes.length === 0}
+
+
+
+ {search ? 'No notes match your search' : filter === 'pinned' ? 'No pinned notes' : filter === 'archived' ? 'No archived notes' : filter === 'trash' ? 'Trash is empty' : 'No notes yet'}
+
+
+ {:else}
+
+ {#each notes as note (note.id)}
+ onNoteClick?.(note.id)} />
+ {/each}
+
+ {/if}
{/if}
diff --git a/src/routes/(app)/notes/[id]/+page.svelte b/src/routes/(app)/notes/[id]/+page.svelte
index 161f1a1..1ee8558 100644
--- a/src/routes/(app)/notes/[id]/+page.svelte
+++ b/src/routes/(app)/notes/[id]/+page.svelte
@@ -87,7 +87,7 @@
-
+