Add shipping method names

This commit is contained in:
2024-12-26 12:59:24 -05:00
parent b874d933f2
commit bb87c47e52

View File

@@ -418,6 +418,18 @@ const ShippingDetails = ({ data }) => {
const locations = data[0]?.shipping?.locations || {};
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 (
<div className="space-y-8">
{/* Shipping Methods */}
@@ -438,7 +450,7 @@ const ShippingDetails = ({ data }) => {
<TableBody>
{methodStats.map((method) => (
<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 / shippedCount) * 100).toFixed(1)}%