chore(react/collections/list): add note count to pagination

This commit is contained in:
Elian Doran 2025-08-30 17:03:21 +03:00
parent a9c5a3105f
commit 49b189e7a9
No known key found for this signature in database
3 changed files with 9 additions and 2 deletions

View File

@ -2024,5 +2024,9 @@
},
"units": {
"percentage": "%"
},
"pagination": {
"page_title": "Page of {{startIndex}} - {{endIndex}}",
"total_notes": "{{count}} notes"
}
}

View File

@ -3,6 +3,7 @@ import { Dispatch, StateUpdater, useEffect, useState } from "preact/hooks";
import FNote from "../../entities/fnote";
import froca from "../../services/froca";
import { useNoteLabel } from "../react/hooks";
import { t } from "../../services/i18n";
interface PaginationContext {
page: number;
@ -29,7 +30,7 @@ export function Pager({ page, pageSize, setPage, pageCount, totalNotes }: Omit<P
children.push((
<a
href="javascript:"
title={`Page of ${startIndex} - ${endIndex}`}
title={t("pagination.page_title", { startIndex, endIndex })}
onClick={() => setPage(i)}
>
{i}
@ -50,6 +51,8 @@ export function Pager({ page, pageSize, setPage, pageCount, totalNotes }: Omit<P
return (
<div class="note-list-pager">
{children}
<span className="note-list-pager-total-count">({t("pagination.total_notes", { count: totalNotes })})</span>
</div>
)
}

View File

@ -49,7 +49,7 @@ class ListOrGridView extends ViewMode<{}> {
// no need to distinguish "note" vs "notes" since in case of one result, there's no paging at all
$pager.append(`<span class="note-list-pager-total-count">(${this.filteredNoteIds.length} notes)</span>`);
$pager.append(`<span class=""></span>`);
}
async renderNote(note: FNote, expand: boolean = false) {