From adb6cde87aec43fb3056301e500f57d80e17e1df Mon Sep 17 00:00:00 2001 From: Daniel Bedeleanu Date: Wed, 15 Apr 2026 11:19:47 +0300 Subject: [PATCH] fix: refactor Inventory page stat cards to use StatCard component - Replace Categories, Item Types, Total Boxes with StatCard - Fixes mobile content overflow with two-column flexbox layout - Responsive font sizing for mobile/desktop - Label truncation for long text --- frontend/app/inventory/page.tsx | 52 +++++++++++++++++---------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/frontend/app/inventory/page.tsx b/frontend/app/inventory/page.tsx index f1ed07e0..eee0da47 100644 --- a/frontend/app/inventory/page.tsx +++ b/frontend/app/inventory/page.tsx @@ -5,16 +5,17 @@ import { db, Item } from '@/lib/db'; import { inventoryApi } from '@/lib/api'; import PageShell from '@/components/PageShell'; import Scanner from '@/components/Scanner'; +import StatCard from '@/components/StatCard'; import { toast } from 'react-hot-toast'; -import { - Package, - ChevronRight, - ChevronDown, - BarChart3, - Layers, - Plus, - Minus, - Trash2, +import { + Package, + ChevronRight, + ChevronDown, + BarChart3, + Layers, + Plus, + Minus, + Trash2, X, AlertTriangle, Tag, @@ -23,7 +24,8 @@ import { Layout, Printer, Download, - Search + Search, + Box } from 'lucide-react'; import { generateBarcode128, getQRCodeURL } from '@/lib/labels'; import { clsx, type ClassValue } from 'clsx'; @@ -266,21 +268,21 @@ export default function InventoryPage() {
{/* Stats Dashboard */}
-
- -

Categories

-

{stats?.total_categories || categories.length}

-
-
- -

Item Types

-

{stats?.total_items || inventory.length}

-
-
- -

Total Boxes

-

{existingBoxes.length}

-
+ + +
{/* Search */}