diff --git a/src/components/admin/store/PickupOrder/index.tsx b/src/components/admin/store/PickupOrder/index.tsx index 81bd1e63..c23bc937 100644 --- a/src/components/admin/store/PickupOrder/index.tsx +++ b/src/components/admin/store/PickupOrder/index.tsx @@ -1,9 +1,11 @@ import { Button, Typography } from '@/components/common'; import { OrderStatusIndicator } from '@/components/store'; import { StoreAPI } from '@/lib/api'; -import { PublicOrderItemWithQuantity, PublicOrderWithItems } from '@/lib/types/apiResponses'; +import { UUID } from '@/lib/types'; +import { PublicOrderWithItems } from '@/lib/types/apiResponses'; import { OrderStatus } from '@/lib/types/enums'; -import { getOrderItemQuantities, reportError } from '@/lib/utils'; +import { getOrderItemQuantities, itemToString, reportError } from '@/lib/utils'; +import { useState } from 'react'; import styles from './style.module.scss'; interface PickupOrderProps { @@ -13,27 +15,23 @@ interface PickupOrderProps { onOrderUpdate: (orders: PublicOrderWithItems) => void; } -const itemToString = (item: PublicOrderItemWithQuantity): string => { - if (item.option.metadata !== null) - return `${item.option.item.itemName} (${item.option.metadata.type}: ${item.option.metadata.value})`; - return item.option.item.itemName; -}; - const PickupOrder = ({ token, canFulfill, order, onOrderUpdate }: PickupOrderProps) => { - const showFulfill = canFulfill && order.status === OrderStatus.PLACED; const itemQuantities = getOrderItemQuantities(order.items); + const [unselected, setUnselected] = useState(new Set()); + return ( {`${order.user.firstName} ${order.user.lastName}`} - {showFulfill && itemQuantities.length > 1 ? ( + {canFulfill ? ( ) : null} @@ -53,10 +51,33 @@ const PickupOrder = ({ token, canFulfill, order, onOrderUpdate }: PickupOrderPro