type T = (k: string) => string; export function ResourceListFooter({ page, limit, total, t, onPrev, onNext, }: { page: number; limit: number; total: number; t: T; onPrev: () => void; onNext: () => void; }) { const pages = Math.max(1, Math.ceil(total / limit)); const from = total === 0 ? 0 : (page - 1) * limit + 1; const to = Math.min(page * limit, total); return (

{t("listRange") .replace("{{from}}", String(from)) .replace("{{to}}", String(to)) .replace("{{total}}", String(total))}

{t("pageIndicator") .replace("{{c}}", String(page)) .replace("{{p}}", String(pages))}
); }