feat: add tabs to sync page and fix pagination

- Separate Sync Status and Sync History into tabs with icons
- Fix pagination in sync history by adding offset parameter
- Update getSyncHistory to support offset for proper pagination
- Update API endpoint to pass offset parameter
- Previous/Next buttons now work correctly to navigate pages

This improves UX by organizing the sync page into logical sections
and enables users to browse through historical sync records.
This commit is contained in:
root 2026-01-24 07:57:09 -05:00
parent 0dee311457
commit f85741c993
4 changed files with 33 additions and 11 deletions

View file

@ -46,7 +46,8 @@ export default function SyncHistoryTable({ refreshKey }: SyncHistoryTableProps)
const fetchHistory = async () => {
try {
setLoading(true);
const response = await fetch(`/api/sync/history?limit=${limit}`);
const offset = (page - 1) * limit;
const response = await fetch(`/api/sync/history?limit=${limit}&offset=${offset}`);
if (response.ok) {
const data = await response.json();
setHistory(data.history || []);