From 1d022cae01ec31bec42d3acdc54bf9712404299e Mon Sep 17 00:00:00 2001 From: Matt Date: Sat, 11 Jan 2025 01:37:55 -0500 Subject: [PATCH] Fix build errors --- .../analytics/CategoryPerformance.tsx | 4 +++ .../analytics/VendorPerformance.tsx | 4 +++ inventory/src/pages/PurchaseOrders.tsx | 31 ++++++++----------- inventory/tsconfig.tsbuildinfo | 2 +- 4 files changed, 22 insertions(+), 19 deletions(-) diff --git a/inventory/src/components/analytics/CategoryPerformance.tsx b/inventory/src/components/analytics/CategoryPerformance.tsx index 60e4a4b..7cd9089 100644 --- a/inventory/src/components/analytics/CategoryPerformance.tsx +++ b/inventory/src/components/analytics/CategoryPerformance.tsx @@ -44,6 +44,10 @@ export function CategoryPerformance() { distribution: rawData.distribution.map((item: any) => ({ ...item, value: Number(item.value) || 0 + })), + trends: rawData.trends.map((item: any) => ({ + ...item, + sales: Number(item.sales) || 0 })) }; }, diff --git a/inventory/src/components/analytics/VendorPerformance.tsx b/inventory/src/components/analytics/VendorPerformance.tsx index dab7737..11e812d 100644 --- a/inventory/src/components/analytics/VendorPerformance.tsx +++ b/inventory/src/components/analytics/VendorPerformance.tsx @@ -46,6 +46,10 @@ export function VendorPerformance() { salesPerProduct: Number(vendor.salesPerProduct) || 0, averageMargin: Number(vendor.averageMargin) || 0, size: Number(vendor.size) || 0 + })), + trends: rawData.trends.map((vendor: any) => ({ + ...vendor, + sales: Number(vendor.sales) || 0 })) }; }, diff --git a/inventory/src/pages/PurchaseOrders.tsx b/inventory/src/pages/PurchaseOrders.tsx index e855c66..9c69c24 100644 --- a/inventory/src/pages/PurchaseOrders.tsx +++ b/inventory/src/pages/PurchaseOrders.tsx @@ -16,7 +16,6 @@ import { Pagination, PaginationContent, PaginationItem, - PaginationLink, PaginationNext, PaginationPrevious, } from '../components/ui/pagination'; @@ -140,7 +139,7 @@ export default function PurchaseOrders() { vendorMetricsData, costAnalysisData ] = await Promise.all([ - purchaseOrdersRes.json(), + purchaseOrdersRes.json() as Promise, vendorMetricsRes.json(), costAnalysisRes.json() ]); @@ -369,26 +368,22 @@ export default function PurchaseOrders() { - setPage(p => Math.max(1, p - 1))} + - {Array.from({ length: pagination.pages }, (_, i) => i + 1).map((p) => ( - - setPage(p)} - isActive={p === page} - > - {p} - - - ))} - setPage(p => Math.min(pagination.pages, p + 1))} + diff --git a/inventory/tsconfig.tsbuildinfo b/inventory/tsconfig.tsbuildinfo index e4109ae..66b8145 100644 --- a/inventory/tsconfig.tsbuildinfo +++ b/inventory/tsconfig.tsbuildinfo @@ -1 +1 @@ -{"root":["./src/app.tsx","./src/config.ts","./src/main.tsx","./src/vite-env.d.ts","./src/components/dashboard/inventorystats.tsx","./src/components/dashboard/overview.tsx","./src/components/dashboard/recentsales.tsx","./src/components/dashboard/salesbycategory.tsx","./src/components/dashboard/trendingproducts.tsx","./src/components/layout/appsidebar.tsx","./src/components/layout/mainlayout.tsx","./src/components/products/producteditdialog.tsx","./src/components/products/productfilters.tsx","./src/components/products/producttable.tsx","./src/components/products/producttableskeleton.tsx","./src/components/ui/alert-dialog.tsx","./src/components/ui/alert.tsx","./src/components/ui/avatar.tsx","./src/components/ui/badge.tsx","./src/components/ui/button.tsx","./src/components/ui/calendar.tsx","./src/components/ui/card.tsx","./src/components/ui/date-range-picker.tsx","./src/components/ui/dialog.tsx","./src/components/ui/input.tsx","./src/components/ui/label.tsx","./src/components/ui/pagination.tsx","./src/components/ui/popover.tsx","./src/components/ui/progress.tsx","./src/components/ui/select.tsx","./src/components/ui/separator.tsx","./src/components/ui/sheet.tsx","./src/components/ui/sidebar.tsx","./src/components/ui/skeleton.tsx","./src/components/ui/sonner.tsx","./src/components/ui/switch.tsx","./src/components/ui/table.tsx","./src/components/ui/tabs.tsx","./src/components/ui/tooltip.tsx","./src/hooks/use-mobile.tsx","./src/lib/utils.ts","./src/pages/dashboard.tsx","./src/pages/import.tsx","./src/pages/orders.tsx","./src/pages/products.tsx","./src/pages/settings.tsx"],"version":"5.6.3"} \ No newline at end of file +{"root":["./src/app.tsx","./src/config.ts","./src/main.tsx","./src/vite-env.d.ts","./src/components/analytics/categoryperformance.tsx","./src/components/analytics/priceanalysis.tsx","./src/components/analytics/profitanalysis.tsx","./src/components/analytics/stockanalysis.tsx","./src/components/analytics/vendorperformance.tsx","./src/components/dashboard/inventorystats.tsx","./src/components/dashboard/overview.tsx","./src/components/dashboard/recentsales.tsx","./src/components/dashboard/salesbycategory.tsx","./src/components/dashboard/trendingproducts.tsx","./src/components/layout/appsidebar.tsx","./src/components/layout/mainlayout.tsx","./src/components/products/producteditdialog.tsx","./src/components/products/productfilters.tsx","./src/components/products/producttable.tsx","./src/components/products/producttableskeleton.tsx","./src/components/ui/alert-dialog.tsx","./src/components/ui/alert.tsx","./src/components/ui/avatar.tsx","./src/components/ui/badge.tsx","./src/components/ui/button.tsx","./src/components/ui/calendar.tsx","./src/components/ui/card.tsx","./src/components/ui/date-range-picker.tsx","./src/components/ui/dialog.tsx","./src/components/ui/input.tsx","./src/components/ui/label.tsx","./src/components/ui/pagination.tsx","./src/components/ui/popover.tsx","./src/components/ui/progress.tsx","./src/components/ui/select.tsx","./src/components/ui/separator.tsx","./src/components/ui/sheet.tsx","./src/components/ui/sidebar.tsx","./src/components/ui/skeleton.tsx","./src/components/ui/sonner.tsx","./src/components/ui/switch.tsx","./src/components/ui/table.tsx","./src/components/ui/tabs.tsx","./src/components/ui/tooltip.tsx","./src/hooks/use-mobile.tsx","./src/lib/utils.ts","./src/pages/analytics.tsx","./src/pages/dashboard.tsx","./src/pages/import.tsx","./src/pages/orders.tsx","./src/pages/products.tsx","./src/pages/purchaseorders.tsx","./src/pages/settings.tsx"],"version":"5.6.3"} \ No newline at end of file