import { useLocalization } from '@akinon/next/hooks'; import React from 'react'; import { Price, Link } from '@theme/components'; import { Image } from '@akinon/next/components/image'; import { getOrderStatus } from 'utils'; export const Order = (props) => { const { t } = useLocalization(); const date = new Date(props.created_date) .toJSON() .slice(0, 10) .split('-') .reverse() .join(' '); const orderStatus = getOrderStatus(props?.status?.value?.toString(), t); return (
{t('account.my_orders.order.order_placed')}
{date}
{t('account.my_orders.order.total')}
{t('account.my_orders.order.order')} # {props.number}
{t('account.my_orders.order.order_detail')}
    {props?.orderitem_set?.slice(0, 3).map((item, index) => ( // TODO: Static image will change (TR)
  • {item?.product?.name}
  • ))} {props?.orderitem_set?.length > 3 && (
    + {props?.orderitem_set?.length - 3}
    )}
{orderStatus?.label}
{props?.orderitem_set?.length} {t('account.my_orders.order.items')}
); };