Fix build errors

This commit is contained in:
2025-01-11 01:37:55 -05:00
parent 1c55257196
commit 1d022cae01
4 changed files with 22 additions and 19 deletions

View File

@@ -44,6 +44,10 @@ export function CategoryPerformance() {
distribution: rawData.distribution.map((item: any) => ({ distribution: rawData.distribution.map((item: any) => ({
...item, ...item,
value: Number(item.value) || 0 value: Number(item.value) || 0
})),
trends: rawData.trends.map((item: any) => ({
...item,
sales: Number(item.sales) || 0
})) }))
}; };
}, },

View File

@@ -46,6 +46,10 @@ export function VendorPerformance() {
salesPerProduct: Number(vendor.salesPerProduct) || 0, salesPerProduct: Number(vendor.salesPerProduct) || 0,
averageMargin: Number(vendor.averageMargin) || 0, averageMargin: Number(vendor.averageMargin) || 0,
size: Number(vendor.size) || 0 size: Number(vendor.size) || 0
})),
trends: rawData.trends.map((vendor: any) => ({
...vendor,
sales: Number(vendor.sales) || 0
})) }))
}; };
}, },

View File

@@ -16,7 +16,6 @@ import {
Pagination, Pagination,
PaginationContent, PaginationContent,
PaginationItem, PaginationItem,
PaginationLink,
PaginationNext, PaginationNext,
PaginationPrevious, PaginationPrevious,
} from '../components/ui/pagination'; } from '../components/ui/pagination';
@@ -140,7 +139,7 @@ export default function PurchaseOrders() {
vendorMetricsData, vendorMetricsData,
costAnalysisData costAnalysisData
] = await Promise.all([ ] = await Promise.all([
purchaseOrdersRes.json(), purchaseOrdersRes.json() as Promise<PurchaseOrdersResponse>,
vendorMetricsRes.json(), vendorMetricsRes.json(),
costAnalysisRes.json() costAnalysisRes.json()
]); ]);
@@ -369,26 +368,22 @@ export default function PurchaseOrders() {
<Pagination> <Pagination>
<PaginationContent> <PaginationContent>
<PaginationItem> <PaginationItem>
<PaginationPrevious <Button
onClick={() => setPage(p => Math.max(1, p - 1))} onClick={() => setPage(page - 1)}
disabled={page === 1} disabled={page === 1}
/> className="h-9 px-4"
>
<PaginationPrevious className="h-4 w-4" />
</Button>
</PaginationItem> </PaginationItem>
{Array.from({ length: pagination.pages }, (_, i) => i + 1).map((p) => (
<PaginationItem key={p}>
<PaginationLink
onClick={() => setPage(p)}
isActive={p === page}
>
{p}
</PaginationLink>
</PaginationItem>
))}
<PaginationItem> <PaginationItem>
<PaginationNext <Button
onClick={() => setPage(p => Math.min(pagination.pages, p + 1))} onClick={() => setPage(page + 1)}
disabled={page === pagination.pages} disabled={page === pagination.pages}
/> className="h-9 px-4"
>
<PaginationNext className="h-4 w-4" />
</Button>
</PaginationItem> </PaginationItem>
</PaginationContent> </PaginationContent>
</Pagination> </Pagination>

View File

@@ -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"} {"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"}