-
History
- {/* History table will be implemented here */}
-
History table placeholder
+
+
History
+
+ Back to Dashboard
+
+
+
+ {error && (
+
+ {error}
+
+ )}
+
+ {/* Date Filters */}
+
+
+
+
+ setStartDate(e.target.value)}
+ className="rounded-md border border-gray-300 px-3 py-2 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500"
+ />
+
+
+
+ setEndDate(e.target.value)}
+ className="rounded-md border border-gray-300 px-3 py-2 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500"
+ />
+
+
+
+
+
+
+
+
+ {/* Total Entries */}
+ {data && (
+
{data.total} entries
+ )}
+
+ {/* Empty State */}
+ {data && data.items.length === 0 && (
+
+
No history found
+
+ Your training history will appear here once data is available.
+
+
+ )}
+
+ {/* History Table */}
+ {data && data.items.length > 0 && (
+
+
+
+
+ |
+ Date
+ |
+
+ Day / Phase
+ |
+
+ Decision
+ |
+
+ Body Battery
+ |
+
+ HRV
+ |
+
+ Intensity
+ |
+
+
+
+ {data.items.map((log) => (
+
+ |
+ {formatDate(log.date)}
+ |
+
+ Day {log.cycleDay}
+
+ {formatPhase(log.phase)}
+
+ |
+
+
+ {log.trainingDecision}
+
+ |
+
+ {log.bodyBatteryCurrent ?? "-"}
+
+ ({log.bodyBatteryYesterdayLow ?? "-"} low)
+
+ |
+
+
+ {log.hrvStatus}
+
+ |
+
+ {log.weekIntensityMinutes} / {log.phaseLimit}
+ |
+
+ ))}
+
+
+
+ )}
+
+ {/* Pagination */}
+ {data && data.totalPages > 1 && (
+
+
+
+ Page {page} of {data.totalPages}
+
+
+
+ )}
);
}