Add shipping method names
This commit is contained in:
@@ -418,6 +418,18 @@ const ShippingDetails = ({ data }) => {
|
|||||||
const locations = data[0]?.shipping?.locations || {};
|
const locations = data[0]?.shipping?.locations || {};
|
||||||
const methodStats = data[0]?.shipping?.methodStats || [];
|
const methodStats = data[0]?.shipping?.methodStats || [];
|
||||||
|
|
||||||
|
// Shipping method name mappings
|
||||||
|
const shippingMethodNames = {
|
||||||
|
'usps_ground_advantage': 'USPS Ground Advantage',
|
||||||
|
'usps_priority': 'USPS Priority',
|
||||||
|
'Unknown': 'Digital',
|
||||||
|
'fedex_ieconomy': 'FedEx Intl Economy',
|
||||||
|
'fedex_homedelivery': 'FedEx Ground',
|
||||||
|
'fedex_ground': 'FedEx Ground',
|
||||||
|
'fedex_iground': 'FedEx Intl Ground',
|
||||||
|
'fedex_2day': 'FedEx 2 Day'
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-8">
|
<div className="space-y-8">
|
||||||
{/* Shipping Methods */}
|
{/* Shipping Methods */}
|
||||||
@@ -438,7 +450,7 @@ const ShippingDetails = ({ data }) => {
|
|||||||
<TableBody>
|
<TableBody>
|
||||||
{methodStats.map((method) => (
|
{methodStats.map((method) => (
|
||||||
<TableRow key={method.name}>
|
<TableRow key={method.name}>
|
||||||
<TableCell className="font-medium">{method.name}</TableCell>
|
<TableCell className="font-medium">{shippingMethodNames[method.name] || method.name}</TableCell>
|
||||||
<TableCell className="text-right">{method.value.toLocaleString()}</TableCell>
|
<TableCell className="text-right">{method.value.toLocaleString()}</TableCell>
|
||||||
<TableCell className="text-right">
|
<TableCell className="text-right">
|
||||||
{((method.value / shippedCount) * 100).toFixed(1)}%
|
{((method.value / shippedCount) * 100).toFixed(1)}%
|
||||||
|
|||||||
Reference in New Issue
Block a user