feat: dashboard tiles link to their matching list page
Each stat tile now navigates to /apiaries, /colonies, /queens, /tasks, /honey-batches or /storage on click instead of being inert.
This commit is contained in:
1 parent
147417d7d4
commit
faefd47e4b
1 file changed
+10
-1
@@ -38,6 +38,7 @@ interface StatTile {
|
|||||||
value: number;
|
value: number;
|
||||||
icon: LucideIcon;
|
icon: LucideIcon;
|
||||||
gradient: string;
|
gradient: string;
|
||||||
|
href: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ALERT_META: Record<
|
const ALERT_META: Record<
|
||||||
@@ -79,30 +80,35 @@ export default function DashboardPage() {
|
|||||||
value: summary.apiariesActive,
|
value: summary.apiariesActive,
|
||||||
icon: MapPin,
|
icon: MapPin,
|
||||||
gradient: "var(--gradient-honey)",
|
gradient: "var(--gradient-honey)",
|
||||||
|
href: "/apiaries",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Aktive Völker",
|
label: "Aktive Völker",
|
||||||
value: summary.coloniesActive,
|
value: summary.coloniesActive,
|
||||||
icon: Layers,
|
icon: Layers,
|
||||||
gradient: "var(--gradient-honey)",
|
gradient: "var(--gradient-honey)",
|
||||||
|
href: "/colonies",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Aktive Königinnen",
|
label: "Aktive Königinnen",
|
||||||
value: summary.queensActive,
|
value: summary.queensActive,
|
||||||
icon: Crown,
|
icon: Crown,
|
||||||
gradient: "var(--gradient-sage)",
|
gradient: "var(--gradient-sage)",
|
||||||
|
href: "/queens",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Offene Aufgaben",
|
label: "Offene Aufgaben",
|
||||||
value: summary.openTasks,
|
value: summary.openTasks,
|
||||||
icon: ListTodo,
|
icon: ListTodo,
|
||||||
gradient: "var(--gradient-sky)",
|
gradient: "var(--gradient-sky)",
|
||||||
|
href: "/tasks",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Honigchargen",
|
label: "Honigchargen",
|
||||||
value: summary.honeyBatchesTotal,
|
value: summary.honeyBatchesTotal,
|
||||||
icon: Droplet,
|
icon: Droplet,
|
||||||
gradient: "var(--gradient-honey)",
|
gradient: "var(--gradient-honey)",
|
||||||
|
href: "/honey-batches",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Artikel unter Mindestbestand",
|
label: "Artikel unter Mindestbestand",
|
||||||
@@ -112,6 +118,7 @@ export default function DashboardPage() {
|
|||||||
summary.stockItemsLowCount > 0
|
summary.stockItemsLowCount > 0
|
||||||
? "linear-gradient(135deg, oklch(0.72 0.15 70) 0%, oklch(0.56 0.15 50) 100%)"
|
? "linear-gradient(135deg, oklch(0.72 0.15 70) 0%, oklch(0.56 0.15 50) 100%)"
|
||||||
: "var(--gradient-sage)",
|
: "var(--gradient-sage)",
|
||||||
|
href: "/storage",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
: [];
|
: [];
|
||||||
@@ -137,7 +144,8 @@ export default function DashboardPage() {
|
|||||||
{tiles.map((tile) => {
|
{tiles.map((tile) => {
|
||||||
const Icon = tile.icon;
|
const Icon = tile.icon;
|
||||||
return (
|
return (
|
||||||
<Card key={tile.label} interactive>
|
<Link key={tile.label} href={tile.href}>
|
||||||
|
<Card interactive>
|
||||||
<CardContent className="flex flex-col gap-3">
|
<CardContent className="flex flex-col gap-3">
|
||||||
<div
|
<div
|
||||||
className="flex size-10 items-center justify-center rounded-xl text-white shadow-[var(--shadow-soft)]"
|
className="flex size-10 items-center justify-center rounded-xl text-white shadow-[var(--shadow-soft)]"
|
||||||
@@ -151,6 +159,7 @@ export default function DashboardPage() {
|
|||||||
</div>
|
</div>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
</Link>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in new issue
Block a user