2019-06-19 14:40:52 +00:00
|
|
|
import DialogContentText from "@material-ui/core/DialogContentText";
|
2019-08-09 10:26:22 +00:00
|
|
|
import React from "react";
|
2019-06-19 14:40:52 +00:00
|
|
|
|
|
|
|
import ActionDialog from "@saleor/components/ActionDialog";
|
|
|
|
import { ConfirmButtonTransitionState } from "@saleor/components/ConfirmButton";
|
|
|
|
import i18n from "../../../i18n";
|
|
|
|
|
|
|
|
export interface OrderDraftCancelDialogProps {
|
|
|
|
confirmButtonState: ConfirmButtonTransitionState;
|
|
|
|
open: boolean;
|
|
|
|
onClose: () => void;
|
|
|
|
onConfirm: () => void;
|
|
|
|
orderNumber: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
const OrderDraftCancelDialog: React.StatelessComponent<
|
|
|
|
OrderDraftCancelDialogProps
|
|
|
|
> = ({ confirmButtonState, onClose, onConfirm, open, orderNumber }) => (
|
|
|
|
<ActionDialog
|
|
|
|
confirmButtonState={confirmButtonState}
|
|
|
|
onClose={onClose}
|
|
|
|
onConfirm={onConfirm}
|
|
|
|
open={open}
|
|
|
|
title={i18n.t("Remove draft order", {
|
|
|
|
context: "modal title"
|
|
|
|
})}
|
|
|
|
variant="delete"
|
|
|
|
>
|
|
|
|
<DialogContentText
|
|
|
|
dangerouslySetInnerHTML={{
|
|
|
|
__html: i18n.t(
|
|
|
|
"Are you sure you want to remove draft <strong>#{{ number }}</strong>?",
|
|
|
|
{
|
|
|
|
context: "modal",
|
|
|
|
number: orderNumber
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</ActionDialog>
|
|
|
|
);
|
|
|
|
OrderDraftCancelDialog.displayName = "OrderDraftCancelDialog";
|
|
|
|
export default OrderDraftCancelDialog;
|