feat: warn on the dashboard when a swarm check is overdue
Schwarmkontrolle already captures nextCheckDate per check, but it was only ever visible by opening that one colony's tab. During swarm season a missed follow-up check can mean losing half the colony, so this now surfaces as a dashboard alert (OVERDUE_SWARM_CHECK) like overdue tasks already do - only the most recent check per colony is considered, so a completed follow-up clears the warning. Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
1 parent
acbf5f16ce
commit
0881a38800
4 files changed
+101
-16
No files matched your search
@@ -12,6 +12,7 @@ import {
|
||||
Layers,
|
||||
PackageSearch,
|
||||
ShieldAlert,
|
||||
Sprout,
|
||||
} from "lucide-react";
|
||||
import { useAuth } from "@/lib/auth/auth-context";
|
||||
import { fetchDashboardAlerts, fetchDashboardSummary } from "@/lib/dashboard/api";
|
||||
@@ -60,6 +61,11 @@ const ALERT_META: Record<
|
||||
icon: PackageSearch,
|
||||
className: "border-warning/40 bg-warning/10",
|
||||
},
|
||||
OVERDUE_SWARM_CHECK: {
|
||||
label: "Schwarmkontrolle überfällig",
|
||||
icon: Sprout,
|
||||
className: "border-destructive/30 bg-destructive/5",
|
||||
},
|
||||
};
|
||||
|
||||
export default function DashboardPage() {
|
||||
|
||||
@@ -7,7 +7,11 @@ export interface DashboardSummary {
|
||||
stockItemsLowCount: number;
|
||||
}
|
||||
|
||||
export type DashboardAlertType = "OVERDUE_TASK" | "COLONY_ATTENTION" | "LOW_STOCK";
|
||||
export type DashboardAlertType =
|
||||
| "OVERDUE_TASK"
|
||||
| "COLONY_ATTENTION"
|
||||
| "LOW_STOCK"
|
||||
| "OVERDUE_SWARM_CHECK";
|
||||
|
||||
export interface DashboardAlert {
|
||||
type: DashboardAlertType;
|
||||
|
||||
Reference in new issue
Block a user