feat: card-grid boxes with Aktiv/Historie split on main list pages

Replace the list-row layout with a responsive box grid (EntityCard):
icon avatar, title, badge, and 1-2 key fields visible at a glance per
box, matching what the user asked for ("Kaestchen" over rows).

Add an Aktiv/Historie tab split (ActiveHistoryTabs) so deactivated or
terminal-status entries move out of the default view instead of mixing
in with active ones:
- Apiaries, Colonies, Queens: split on deactivatedAt (the field the app
  already uses everywhere for "Historie statt Loeschen").
- Task templates: split on the existing active boolean.
- Tasks: OPEN/IN_PROGRESS vs DONE/CANCELLED.
- Honey batches: everything vs SOLD/CONSUMED.
- Products: ACTIVE vs DISCONTINUED.
- Storage containers: everything vs OUT_OF_SERVICE.
Equipment and stock items have no lifecycle field in the schema, so
they keep the plain grid without a Historie tab.

Verified live: deactivating a Bienenstand moves it out of Aktiv into
Historie immediately, both counts update, reactivating moves it back.
This commit is contained in:
Nick Szaunig committed 2026-08-26 00:25:23 +02:00
1 parent c586bff18f
commit d31aa79f50
12 files changed
+496 -320

No files matched your search

@@ -9,7 +9,7 @@ import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { PageHeader } from "@/components/page-header";
import { EmptyState } from "@/components/empty-state";
import { ListItemCard } from "@/components/list-item-card";
import { EntityCard } from "@/components/entity-card";
export default function EquipmentPage() {
const { data: equipmentList, isLoading, isError } = useQuery({
@@ -47,16 +47,17 @@ export default function EquipmentPage() {
) : null}
{equipmentList && equipmentList.length > 0 ? (
<div className="flex flex-col gap-2">
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3">
{equipmentList.map((item) => (
<ListItemCard
<EntityCard
key={item.id}
href={`/equipment/${item.id}`}
icon={Wrench}
gradient="var(--gradient-sage)"
title={item.name}
subtitle={`${item.inventoryNumber} · ${item.location ?? "—"}`}
trailing={<Badge variant={statusTone(item.condition)}>{item.condition}</Badge>}
subtitle={item.inventoryNumber}
badge={<Badge variant={statusTone(item.condition)}>{item.condition}</Badge>}
fields={[{ label: "Standort", value: item.location ?? "—" }]}
/>
))}
</div>