Improve profit analytics chart and modal data handling
Enhanced ProfitAnalyticsChart to display more robust skeleton loaders and improved summary card logic with fallbacks for missing data. Updated the chart to distinguish between tracked and total revenue, and improved cost data coverage display. In the profit analysis modal, profit margin tiers are now sorted by minimum quantity. Updated the ProfitOverview interface to include revenueFromTrackedProducts.
This commit is contained in:
@@ -205,7 +205,9 @@ export const ProfitAnalysisModal: React.FC<ProfitAnalysisModalProps> = ({
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="space-y-4">
|
||||
{profitData.profitMargins.map((tier, index) => {
|
||||
{profitData.profitMargins
|
||||
.sort((a, b) => a.minQuantity - b.minQuantity)
|
||||
.map((tier, index) => {
|
||||
const ProfitIcon = getProfitIcon(tier.profit);
|
||||
|
||||
const totalProfitForMinQty = tier.profit !== null ? tier.profit * tier.minQuantity : null;
|
||||
|
||||
Reference in New Issue
Block a user