feat(manager-app): Part 5 — show snapshot_taken_at freshness in DashboardPage
Adds a "Site data: X min ago" line derived from snapshot.snapshot_taken_at so managers can see how fresh the stats snapshot is. All other Part 5 items (menu-app api.js, OrderConfirm polling, manager-app api.js, IncomingOrdersPage 15s poll + OrderCard actions) were already fully implemented in the existing scaffolding. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -64,10 +64,20 @@ export default function DashboardPage() {
|
|||||||
|
|
||||||
{lastUpdated && (
|
{lastUpdated && (
|
||||||
<p className="text-xs text-slate-400 text-right">
|
<p className="text-xs text-slate-400 text-right">
|
||||||
Updated {lastUpdated.toLocaleTimeString()}
|
Refreshed {lastUpdated.toLocaleTimeString()}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{stats.snapshot_taken_at && (() => {
|
||||||
|
const diffMin = Math.round((Date.now() - new Date(stats.snapshot_taken_at).getTime()) / 60_000)
|
||||||
|
const label = diffMin < 1 ? 'just now' : `${diffMin} min ago`
|
||||||
|
return (
|
||||||
|
<p className="text-xs text-slate-400 text-right -mt-3">
|
||||||
|
Site data: {label}
|
||||||
|
</p>
|
||||||
|
)
|
||||||
|
})()}
|
||||||
|
|
||||||
{/* Pending orders */}
|
{/* Pending orders */}
|
||||||
<div className="space-y-3">
|
<div className="space-y-3">
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
|
|||||||
Reference in New Issue
Block a user