import React from 'react'; import { useTranslation } from 'react-i18next'; import { IApplication } from '../../models/application'; import { react2angular } from 'react2angular'; import { Loader } from '../base/loader'; import noImage from '../../../../images/no_image.png'; declare const Application: IApplication; interface ShowOrderProps { orderRef: string, onError: (message: string) => void, onSuccess: (message: string) => void } /** * This component shows an order details */ export const ShowOrder: React.FC = ({ orderRef, onError, onSuccess }) => { const { t } = useTranslation('admin'); /** * Returns a className according to the status */ const statusColor = (status: string) => { switch (status) { case 'error': return 'error'; case 'canceled': return 'canceled'; case 'pending' || 'under_preparation': return 'pending'; default: return 'normal'; } }; return (

[order.ref]

{t('app.admin.store.show_order.see_invoice')}
{t('app.admin.store.show_order.client')}

order.user.name

{t('app.admin.store.show_order.created_at')}

order.created_at

{t('app.admin.store.show_order.last_update')}

order.???

order.state
{/* loop sur les articles du panier */}
{t('app.admin.store.show_order.reference_short')} orderable_id?

o.orderable_name

o.amount

/ {t('app.admin.store.show_order.unit')}
o.quantity
{t('app.admin.store.show_order.item_total')}

o.quantity * o.amount

Lorem ipsum dolor sit amet consectetur adipisicing elit. Ipsum rerum commodi quaerat possimus! Odit, harum.

{t('app.admin.store.show_order.products_total')}order.amount

{t('app.admin.store.show_order.gift_total')}-order.amount

{t('app.admin.store.show_order.coupon')}order.amount

{t('app.admin.store.show_order.total')} order.total

); }; const ShowOrderWrapper: React.FC = (props) => { return ( ); }; Application.Components.component('showOrder', react2angular(ShowOrderWrapper, ['orderRef', 'onError', 'onSuccess']));