diff --git a/src/App.tsx b/src/App.tsx index afaa2ad..74669c9 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -11,10 +11,6 @@ import { ProductList } from './components/ProductList'; import { ProductForm } from './components/ProductForm'; import { Loader2 } from 'lucide-react'; -const BarcodeScanner = lazy(() => - import('./components/BarcodeScanner').then((m) => ({ default: m.BarcodeScanner })) -); - const Settings = lazy(() => import('./components/Settings').then((m) => ({ default: m.Settings })) ); @@ -41,12 +37,6 @@ function PageContent() { return ; case 'add': return ; - case 'scanner': - return ( - }> - - - ); case 'settings': return ( }> diff --git a/src/components/Dashboard.tsx b/src/components/Dashboard.tsx index 5ded77e..21468a1 100644 --- a/src/components/Dashboard.tsx +++ b/src/components/Dashboard.tsx @@ -8,7 +8,6 @@ import type { ProductCategory } from '../types'; import { StatRing } from './StatRing'; import { Package, - ScanBarcode, PlusCircle, TrendingDown, ChevronRight, @@ -32,6 +31,7 @@ const URGENT_TEXT_COLORS: Record = { export function Dashboard() { const setPage = useAppStore((s) => s.setPage); + const setEditingProductId = useAppStore((s) => s.setEditingProductId); const products = useLiveQuery(() => db.products.toArray()) ?? []; const { t } = useTranslation(); @@ -73,13 +73,9 @@ export function Dashboard() {

{t('dashboard.noProducts')}

{t('dashboard.noProductsDesc')}

- -
@@ -98,12 +94,12 @@ export function Dashboard() {
- diff --git a/src/components/Navigation.tsx b/src/components/Navigation.tsx index 9096903..fbe72dc 100644 --- a/src/components/Navigation.tsx +++ b/src/components/Navigation.tsx @@ -3,17 +3,17 @@ import { useAppStore } from '../store/useAppStore'; import { LayoutDashboard, Package, - PlusCircle, - ScanBarcode, + Plus, Settings, BarChart3, } from 'lucide-react'; -const NAV_ITEMS = [ +const LEFT_ITEMS = [ { id: 'dashboard' as const, labelKey: 'nav.dashboard', icon: LayoutDashboard }, { id: 'products' as const, labelKey: 'nav.products', icon: Package }, - { id: 'add' as const, labelKey: 'nav.add', icon: PlusCircle }, - { id: 'scanner' as const, labelKey: 'nav.scanner', icon: ScanBarcode }, +]; + +const RIGHT_ITEMS = [ { id: 'stats' as const, labelKey: 'nav.stats', icon: BarChart3 }, { id: 'settings' as const, labelKey: 'nav.settings', icon: Settings }, ]; @@ -21,17 +21,57 @@ const NAV_ITEMS = [ export function Navigation() { const { currentPage, setPage, setEditingProductId } = useAppStore(); const { t } = useTranslation(); + const isAddActive = currentPage === 'add'; return (