-
Notes
+
{isEntityView ? selection.entry.title : 'Notes'}
- {displayed.length}
+ {totalCount}
@@ -164,46 +272,51 @@ export function NoteList({ entries, selection, selectedNote, allContent, onSelec
onChange={(e) => setSearch(e.target.value)}
/>
-
- {TYPE_PILLS.filter(({ type }) => {
- const count = typeCounts.get(type) ?? 0
- return type === null || count > 0
- }).map(({ label, type }) => {
- const count = typeCounts.get(type) ?? 0
- return (
-
- )
- })}
-
+ {!isEntityView && (
+
+ {TYPE_PILLS.filter(({ type }) => {
+ const count = typeCounts.get(type) ?? 0
+ return type === null || count > 0
+ }).map(({ label, type }) => {
+ const count = typeCounts.get(type) ?? 0
+ return (
+
+ )
+ })}
+
+ )}
- {displayed.length === 0 ? (
-
No notes found
+ {isEntityView ? (
+ <>
+ {renderItem(selection.entry, true)}
+ {searchedGroups.length === 0 ? (
+
+ {query ? 'No matching items' : 'No related items'}
+
+ ) : (
+ searchedGroups.map((group) => (
+
+
+ {group.label}
+ {group.entries.length}
+
+ {group.entries.map((entry) => renderItem(entry))}
+
+ ))
+ )}
+ >
) : (
- displayed.map((entry, i) => (
-
onSelectNote(entry)}
- >
-
-
{entry.title}
-
{relativeDate(getDisplayDate(entry))}
-
-
{getSnippet(allContent[entry.path])}
-
- {entry.isA && {entry.isA}}
- {entry.status && {entry.status}}
-
-
- ))
+ displayed.length === 0 ? (
+
No notes found
+ ) : (
+ displayed.map((entry) => renderItem(entry))
+ )
)}