import { createStyles, Theme, withStyles, WithStyles } from "@material-ui/core/styles"; import * as React from "react"; import Link from "@saleor/components/Link"; import Money from "@saleor/components/Money"; import Skeleton from "@saleor/components/Skeleton"; import i18n from "../../../i18n"; import { maybe } from "../../../misc"; import { OrderDetails_order } from "../../types/OrderDetails"; const styles = (theme: Theme) => createStyles({ root: { ...theme.typography.body2, lineHeight: 1.9, width: "100%" }, textRight: { textAlign: "right" } }); interface OrderDraftDetailsSummaryProps extends WithStyles { order: OrderDetails_order; onShippingMethodEdit: () => void; } const OrderDraftDetailsSummary = withStyles(styles, { name: "OrderDraftDetailsSummary" })( ({ classes, order, onShippingMethodEdit }: OrderDraftDetailsSummaryProps) => ( {maybe(() => order.subtotal) ? ( <> ) : ( )} {order && order.shippingMethod !== undefined && order.shippingMethodName !== undefined ? ( order.shippingMethod === null ? ( order.availableShippingMethods && order.availableShippingMethods.length > 0 ? ( ) : ( ) ) : ( <> ) ) : ( )} {maybe(() => order.total.tax) !== undefined ? ( <> ) : ( )} {maybe(() => order.total.gross) !== undefined ? ( <> ) : ( )}
{i18n.t("Subtotal")}
{i18n.t("Add shipping carrier")} {i18n.t("No applicable shipping carriers")} {order.shippingMethodName} {maybe(() => order.shippingPrice) ? ( ) : ( "---" )}
{i18n.t("Taxes (VAT included)")}
{i18n.t("Total")}
) ); OrderDraftDetailsSummary.displayName = "OrderDraftDetailsSummary"; export default OrderDraftDetailsSummary;