diff --git a/src/app/[name]/(Dialogs)/order/checkout/[id]/components/ShippingSection.tsx b/src/app/[name]/(Dialogs)/order/checkout/[id]/components/ShippingSection.tsx index ec08fd7..cdfe81c 100644 --- a/src/app/[name]/(Dialogs)/order/checkout/[id]/components/ShippingSection.tsx +++ b/src/app/[name]/(Dialogs)/order/checkout/[id]/components/ShippingSection.tsx @@ -1,7 +1,7 @@ 'use client'; import Combobox from '@/components/combobox/Combobox'; -import { Box } from 'iconsax-react'; +import { Box, Location, Car, TruckTick, Building } from 'iconsax-react'; import { useTranslation } from 'react-i18next'; import { useGetShipmentMethod } from '../../hooks/useOrderData'; import { DeliveryMethod } from '../../types/Types'; @@ -24,13 +24,28 @@ export const ShippingSection = ({ deliveryType, onDeliveryTypeChange }: Shipping return tOrders(`deliveryMethod.${translationKey}`); }; + const getDeliveryMethodIcon = (method: string) => { + switch (method) { + case 'dineIn': + return Building; + case 'pickup': + return Location; + case 'deliveryCar': + return Car; + case 'deliveryCourier': + return TruckTick; + default: + return Box; + } + }; + const options = shipmentMethod?.data .filter((item: DeliveryMethod) => item.enabled) .sort((a: DeliveryMethod, b: DeliveryMethod) => a.order - b.order) .map((item: DeliveryMethod) => ({ id: item.id, title: getDeliveryMethodTranslation(item.method), - icon: Box + icon: getDeliveryMethodIcon(item.method) })) || []; return (