saleor-dashboard/src/orders/components/OrderCustomer/PickupAnnotation.tsx
Dawid f01966f0d4
Handle errors on finalizing draft order (#2191)
* Add warning alert before finilizing draft order

* Add line error indicators in draft order view

* Handle unfilled fields errors before draft order finalize

* Handle draft order line errors

* Differentiate line alert severity

* Fix order line alert margin

* Remove unnecessairy comment

* Refactor order draft alert components

* Update order draft test snapshots

* Refaactor order details code

* Hide add products button when no products available on order draft page

* Hide no shipping methods warning if they cannot be determined

* Update product assignment dialog messaages

* Update order channel error messages

* Fix missing order lines in error crash
2022-08-10 10:11:32 +01:00

35 lines
988 B
TypeScript

import { Typography } from "@material-ui/core";
import FormSpacer from "@saleor/components/FormSpacer";
import {
OrderDetailsFragment,
WarehouseClickAndCollectOptionEnum,
} from "@saleor/graphql";
import React from "react";
import { FormattedMessage } from "react-intl";
import messages from "./messages";
interface PickupAnnotationProps {
order?: OrderDetailsFragment;
}
export const PickupAnnotation: React.FC<PickupAnnotationProps> = ({
order,
}) => {
if (order?.deliveryMethod?.__typename === "Warehouse") {
return (
<>
<FormSpacer />
<Typography variant="caption" color="textSecondary">
{order?.deliveryMethod?.clickAndCollectOption ===
WarehouseClickAndCollectOptionEnum.LOCAL ? (
<FormattedMessage {...messages.orderCustomerFulfillmentLocal} />
) : (
<FormattedMessage {...messages.orderCustomerFulfillmentAll} />
)}
</Typography>
</>
);
}
return null;
};