feat(frontend): einheitliche Seiten-Header mit Icon-Badge
Neue PageHeader-Komponente (Gradient-Icon-Badge + Titel + Beschreibung + Aktionen) ersetzt die nackten <h1>-Zeilen auf den meistgenutzten Seiten (Voelker, Bienenstaende, Koeniginnen, Aufgaben, Honigchargen, Statistik, Webhooks, Benutzerverwaltung). Gradient variiert pro Bereich (Honig/Salbei/Himmel), passend zum jeweiligen Sidebar-Icon.
This commit is contained in:
1 parent
3af56c96fa
commit
60b59c120a
9 files changed
+142
-63
No files matched your search
@@ -2,6 +2,7 @@
|
||||
|
||||
import { useState } from "react";
|
||||
import Link from "next/link";
|
||||
import { Layers } from "lucide-react";
|
||||
import { useMutation, useQuery } from "@tanstack/react-query";
|
||||
import { fetchColonies } from "@/lib/colonies/api";
|
||||
import { ColonyStatus } from "@/lib/colonies/types";
|
||||
@@ -9,6 +10,7 @@ import { exportColoniesCsv } from "@/lib/export/api";
|
||||
import { statusTone } from "@/lib/status-tone";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { PageHeader } from "@/components/page-header";
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
@@ -48,21 +50,25 @@ export default function ColoniesPage() {
|
||||
|
||||
return (
|
||||
<main className="flex flex-col gap-4 p-4 sm:p-6">
|
||||
<div className="flex items-center justify-between">
|
||||
<h1 className="text-2xl font-semibold tracking-tight">Völker</h1>
|
||||
<div className="flex gap-2">
|
||||
<Button
|
||||
variant="outline"
|
||||
disabled={exportMutation.isPending}
|
||||
onClick={() => exportMutation.mutate()}
|
||||
>
|
||||
CSV exportieren
|
||||
</Button>
|
||||
<Button nativeButton={false} render={<Link href="/colonies/new" />}>
|
||||
+ Neues Volk
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<PageHeader
|
||||
icon={Layers}
|
||||
title="Völker"
|
||||
description="Alle Bienenvölker im Überblick"
|
||||
actions={
|
||||
<>
|
||||
<Button
|
||||
variant="outline"
|
||||
disabled={exportMutation.isPending}
|
||||
onClick={() => exportMutation.mutate()}
|
||||
>
|
||||
CSV exportieren
|
||||
</Button>
|
||||
<Button nativeButton={false} render={<Link href="/colonies/new" />}>
|
||||
+ Neues Volk
|
||||
</Button>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
|
||||
<Select
|
||||
value={status || "ALL"}
|
||||
|
||||
Reference in new issue
Block a user