diff --git a/frontend/app/page.tsx b/frontend/app/page.tsx index 66607351..adc201f0 100644 --- a/frontend/app/page.tsx +++ b/frontend/app/page.tsx @@ -11,6 +11,9 @@ import Scanner from '@/components/Scanner'; import AIOnboarding from '@/components/AIOnboarding'; import PageShell from '@/components/PageShell'; import ItemComparisonModal from '@/components/ItemComparisonModal'; +import StockAdjustmentPanel from '@/components/StockAdjustmentPanel'; +import NewItemDialog from '@/components/NewItemDialog'; +import ScannerSection from '@/components/ScannerSection'; import { toast } from 'react-hot-toast'; import { Package, @@ -23,10 +26,6 @@ import { ChevronRight, Edit2, RefreshCw, - Sparkles, - Smartphone, - ArrowDownCircle, - ArrowUpCircle, Search } from 'lucide-react'; import { generateBarcode128, getQRCodeURL } from '@/lib/labels'; @@ -360,71 +359,15 @@ export default function Home() { -
- {/* Mode Switcher */} -
- {[ - { id: 'CHECK_IN', label: 'Check In', icon: ArrowDownCircle }, - { id: 'CHECK_OUT', label: 'Check Out', icon: ArrowUpCircle }, - { id: 'TRASH', label: 'Trash', icon: Trash2 } - ].map((m) => ( - - ))} -
- - {/* Scanner Section */} -
- {showScanner ? ( -
-
-

scanning...

- -
- -
- ) : ( -
- - -
- -
-
- )} -
-
+ setMode(newMode as any)} + showScanner={showScanner} + onShowScanner={setShowScanner} + onScanSuccess={onScanSuccess} + onOCRMatch={onOCRMatch} + onAddItemClick={() => setShowOnboarding(true)} + /> {/* Onboarding Overlay */} {showOnboarding && ( @@ -446,267 +389,37 @@ export default function Home() { loading={comparisonLoading} /> - {/* Stock Adjustment Overlay */} - {selectedItem && ( -
-
-
-

- {isEditing ? "Edit Metadata" : selectedItem.name} - {!isEditing && ( - - In Stock: {selectedItem.quantity} - - )} -

-
- {!isEditing && ( - - )} - {isEditing && ( - - )} - -
-
+ {/* Stock Adjustment Panel */} + { + setSelectedItem(null); + setIsEditing(false); + }} + onEdit={(item) => { + setEditedItem(item); + setIsEditing(true); + }} + onEditChange={setEditedItem} + onQuantityChange={setAdjustQty} + onTypeChange={setAdjustType} + onReasonChange={setTrashReason} + onShowScanner={(active, field) => { + setFieldScanning({ active, field }); + setShowScanner(true); + }} + onAdjustStock={handleAdjustStock} + onUpdateItem={handleUpdateItem} + onDeleteItem={handleDeleteItem} + /> - {isEditing ? ( -
-
-
- -