Initial commit: mini-erp (backend FastAPI + frontend React/Vite)
Base para el flujo de ramas por cliente. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
commit
ab3c613165
154 files changed
+16872
No files matched your search
@@ -0,0 +1,49 @@
|
||||
interface PaginationBarProps {
|
||||
skip: number;
|
||||
top: number;
|
||||
currentCount: number;
|
||||
totalCount?: number;
|
||||
loading?: boolean;
|
||||
onPrevious: () => void;
|
||||
onNext: () => void;
|
||||
}
|
||||
|
||||
export default function PaginationBar({
|
||||
skip,
|
||||
top,
|
||||
currentCount,
|
||||
totalCount,
|
||||
loading = false,
|
||||
onPrevious,
|
||||
onNext,
|
||||
}: PaginationBarProps) {
|
||||
const from = currentCount > 0 ? skip + 1 : 0;
|
||||
const to = skip + currentCount;
|
||||
|
||||
return (
|
||||
<div className="mt-2 flex items-center justify-between border-t border-[var(--color-border-light)] pt-2">
|
||||
<div className="text-xs text-[var(--color-text-muted)]">
|
||||
Registros {from} - {to}
|
||||
{totalCount != null && totalCount > 0 ? ` de ${totalCount}` : ""}
|
||||
</div>
|
||||
|
||||
<div className="flex gap-1">
|
||||
<button
|
||||
onClick={onPrevious}
|
||||
disabled={skip === 0 || loading}
|
||||
className="px-3 py-1 text-xs border border-[var(--color-border)] bg-white disabled:opacity-50 disabled:cursor-not-allowed"
|
||||
>
|
||||
◀ Anterior
|
||||
</button>
|
||||
|
||||
<button
|
||||
onClick={onNext}
|
||||
disabled={totalCount != null ? skip + top >= totalCount || loading : currentCount < top || loading}
|
||||
className="px-3 py-1 text-xs border border-[var(--color-border)] bg-white disabled:opacity-50 disabled:cursor-not-allowed"
|
||||
>
|
||||
Siguiente ▶
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user