From c0922387fd2e05a7ae5beba35a9f1677d41ee762 Mon Sep 17 00:00:00 2001 From: Nick Szaunig Date: Mon, 24 Aug 2026 00:27:04 +0200 Subject: [PATCH] =?UTF-8?q?feat(frontend):=20EmptyState=20statt=20Flie?= =?UTF-8?q?=C3=9Ftext=20in=20verschachtelten=20Listen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ersetzt den bisherigen reinen Fließtext ("Noch keine X dokumentiert.") durch die gemeinsame EmptyState-Komponente (Icon, Titel, Beschreibung) in allen verschachtelten Listen auf den Volk- und Königin-Detailseiten: Fütterung, Behandlungen, Varroa, Durchsichten, Historie (Volk und Königin), Bewertungen und Honigmessungen. Rundet den bereits umgesetzten EmptyState-Look der Hauptlistenseiten konsistent auf die Detailseiten-Unterkarten ab. --- .../src/app/(app)/colonies/[id]/colony-feedings.tsx | 8 +++++++- .../src/app/(app)/colonies/[id]/colony-history.tsx | 8 +++++++- .../src/app/(app)/colonies/[id]/colony-inspections.tsx | 8 +++++++- .../src/app/(app)/colonies/[id]/colony-treatments.tsx | 8 +++++++- .../src/app/(app)/colonies/[id]/colony-varroa.tsx | 8 +++++++- .../src/app/(app)/honey-batches/[id]/page.tsx | 9 +++++++-- .../src/app/(app)/queens/[id]/queen-evaluations.tsx | 8 +++++++- .../src/app/(app)/queens/[id]/queen-history.tsx | 8 +++++++- 8 files changed, 56 insertions(+), 9 deletions(-) diff --git a/ApiCore-Frontend/src/app/(app)/colonies/[id]/colony-feedings.tsx b/ApiCore-Frontend/src/app/(app)/colonies/[id]/colony-feedings.tsx index 2e64f5b..96aa45b 100644 --- a/ApiCore-Frontend/src/app/(app)/colonies/[id]/colony-feedings.tsx +++ b/ApiCore-Frontend/src/app/(app)/colonies/[id]/colony-feedings.tsx @@ -1,9 +1,11 @@ "use client"; import Link from "next/link"; +import { Utensils } from "lucide-react"; import { useQuery } from "@tanstack/react-query"; import { fetchColonyFeedings, fetchColonyFeedingsSummary } from "@/lib/feedings/api"; import { Button } from "@/components/ui/button"; +import { EmptyState } from "@/components/empty-state"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; export function ColonyFeedingsCard({ colonyId }: { colonyId: string }) { @@ -39,7 +41,11 @@ export function ColonyFeedingsCard({ colonyId }: { colonyId: string }) { ) : null} {isLoading ?

Lädt…

: null} {!isLoading && (!feedings || feedings.length === 0) ? ( -

Noch keine Fütterung dokumentiert.

+ ) : null} {feedings?.map((feeding) => (
diff --git a/ApiCore-Frontend/src/app/(app)/colonies/[id]/colony-history.tsx b/ApiCore-Frontend/src/app/(app)/colonies/[id]/colony-history.tsx index 85a984b..c9b7ee7 100644 --- a/ApiCore-Frontend/src/app/(app)/colonies/[id]/colony-history.tsx +++ b/ApiCore-Frontend/src/app/(app)/colonies/[id]/colony-history.tsx @@ -1,7 +1,9 @@ "use client"; +import { History } from "lucide-react"; import { useQuery } from "@tanstack/react-query"; import { fetchColonyHistory } from "@/lib/colonies/api"; +import { EmptyState } from "@/components/empty-state"; import { Card, CardContent, @@ -31,7 +33,11 @@ export function ColonyHistoryCard({ colonyId }: { colonyId: string }) { {!hasHistory ? ( -

Noch keine Historie vorhanden.

+ ) : null} {history.apiaryHistory.map((entry) => (

diff --git a/ApiCore-Frontend/src/app/(app)/colonies/[id]/colony-inspections.tsx b/ApiCore-Frontend/src/app/(app)/colonies/[id]/colony-inspections.tsx index 9e34cf8..552f3a1 100644 --- a/ApiCore-Frontend/src/app/(app)/colonies/[id]/colony-inspections.tsx +++ b/ApiCore-Frontend/src/app/(app)/colonies/[id]/colony-inspections.tsx @@ -1,9 +1,11 @@ "use client"; import Link from "next/link"; +import { ClipboardCheck } from "lucide-react"; import { useQuery } from "@tanstack/react-query"; import { fetchColonyInspections } from "@/lib/inspections/api"; import { Button } from "@/components/ui/button"; +import { EmptyState } from "@/components/empty-state"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; export function ColonyInspectionsCard({ colonyId }: { colonyId: string }) { @@ -27,7 +29,11 @@ export function ColonyInspectionsCard({ colonyId }: { colonyId: string }) { {isLoading ?

Lädt…

: null} {!isLoading && (!inspections || inspections.length === 0) ? ( -

Noch keine Durchsicht dokumentiert.

+ ) : null} {inspections?.map((inspection) => (
diff --git a/ApiCore-Frontend/src/app/(app)/colonies/[id]/colony-treatments.tsx b/ApiCore-Frontend/src/app/(app)/colonies/[id]/colony-treatments.tsx index 1346c25..f1c6006 100644 --- a/ApiCore-Frontend/src/app/(app)/colonies/[id]/colony-treatments.tsx +++ b/ApiCore-Frontend/src/app/(app)/colonies/[id]/colony-treatments.tsx @@ -1,9 +1,11 @@ "use client"; import Link from "next/link"; +import { Syringe } from "lucide-react"; import { useQuery } from "@tanstack/react-query"; import { fetchColonyTreatments } from "@/lib/treatments/api"; import { Button } from "@/components/ui/button"; +import { EmptyState } from "@/components/empty-state"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; export function ColonyTreatmentsCard({ colonyId }: { colonyId: string }) { @@ -27,7 +29,11 @@ export function ColonyTreatmentsCard({ colonyId }: { colonyId: string }) { {isLoading ?

Lädt…

: null} {!isLoading && (!treatments || treatments.length === 0) ? ( -

Noch keine Behandlung dokumentiert.

+ ) : null} {treatments?.map((treatment) => (
diff --git a/ApiCore-Frontend/src/app/(app)/colonies/[id]/colony-varroa.tsx b/ApiCore-Frontend/src/app/(app)/colonies/[id]/colony-varroa.tsx index 853380a..f043aa6 100644 --- a/ApiCore-Frontend/src/app/(app)/colonies/[id]/colony-varroa.tsx +++ b/ApiCore-Frontend/src/app/(app)/colonies/[id]/colony-varroa.tsx @@ -1,9 +1,11 @@ "use client"; import Link from "next/link"; +import { Bug } from "lucide-react"; import { useQuery } from "@tanstack/react-query"; import { fetchColonyVarroaMeasurements } from "@/lib/varroa/api"; import { Button } from "@/components/ui/button"; +import { EmptyState } from "@/components/empty-state"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; const CHART_WIDTH = 280; @@ -64,7 +66,11 @@ export function ColonyVarroaCard({ colonyId }: { colonyId: string }) { {isLoading ?

Lädt…

: null} {!isLoading && (!measurements || measurements.length === 0) ? ( -

Noch keine Varroamessung dokumentiert.

+ ) : null} {measurements?.map((measurement) => ( diff --git a/ApiCore-Frontend/src/app/(app)/honey-batches/[id]/page.tsx b/ApiCore-Frontend/src/app/(app)/honey-batches/[id]/page.tsx index fb66004..1d0b8d2 100644 --- a/ApiCore-Frontend/src/app/(app)/honey-batches/[id]/page.tsx +++ b/ApiCore-Frontend/src/app/(app)/honey-batches/[id]/page.tsx @@ -2,11 +2,12 @@ import Link from "next/link"; import { useParams } from "next/navigation"; -import { Droplet } from "lucide-react"; +import { Droplet, FlaskConical } from "lucide-react"; import { useMutation, useQuery } from "@tanstack/react-query"; import { fetchHoneyBatch, fetchHoneyBatchTraceability } from "@/lib/honey-batches/api"; import { exportHoneyBatchTraceabilityPdf } from "@/lib/export/api"; import { QrCodeDialog } from "@/components/qr-code-dialog"; +import { EmptyState } from "@/components/empty-state"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; @@ -78,7 +79,11 @@ export default function HoneyBatchDetailPage() { {honeyBatch.measurements.length === 0 ? ( -

Noch keine Messung dokumentiert.

+ ) : null} {honeyBatch.measurements.map((measurement) => (
diff --git a/ApiCore-Frontend/src/app/(app)/queens/[id]/queen-evaluations.tsx b/ApiCore-Frontend/src/app/(app)/queens/[id]/queen-evaluations.tsx index dc64618..589dc1c 100644 --- a/ApiCore-Frontend/src/app/(app)/queens/[id]/queen-evaluations.tsx +++ b/ApiCore-Frontend/src/app/(app)/queens/[id]/queen-evaluations.tsx @@ -1,12 +1,14 @@ "use client"; import { FormEvent, useState } from "react"; +import { Star } from "lucide-react"; import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { addQueenEvaluation, fetchQueenEvaluations } from "@/lib/queens/api"; import { CreateQueenEvaluationInput } from "@/lib/queens/types"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; +import { EmptyState } from "@/components/empty-state"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Dialog, @@ -131,7 +133,11 @@ export function QueenEvaluationsCard({ queenId }: { queenId: string }) { {isLoading ?

Lädt…

: null} {!isLoading && (!evaluations || evaluations.length === 0) ? ( -

Noch keine Bewertung dokumentiert.

+ ) : null} {evaluations?.map((evaluation) => (
diff --git a/ApiCore-Frontend/src/app/(app)/queens/[id]/queen-history.tsx b/ApiCore-Frontend/src/app/(app)/queens/[id]/queen-history.tsx index 82e29b9..bf869d6 100644 --- a/ApiCore-Frontend/src/app/(app)/queens/[id]/queen-history.tsx +++ b/ApiCore-Frontend/src/app/(app)/queens/[id]/queen-history.tsx @@ -1,7 +1,9 @@ "use client"; +import { History } from "lucide-react"; import { useQuery } from "@tanstack/react-query"; import { fetchQueenHistory } from "@/lib/queens/api"; +import { EmptyState } from "@/components/empty-state"; import { Card, CardContent, @@ -26,7 +28,11 @@ export function QueenHistoryCard({ queenId }: { queenId: string }) { {history.length === 0 ? ( -

Noch keine Historie vorhanden.

+ ) : null} {history.map((entry) => (