saleor-dashboard/src/attributes/components/AttributeValueDeleteDialog/AttributeValueDeleteDialog.tsx
Michał Droń d5c9a3dae8
Add trailing commas (#2062)
* Require trailing commas

* Add trailing commas

* Add trailing commas in testUtils dir

* Add trailing commas
2022-06-21 11:36:55 +02:00

67 lines
1.8 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { DialogContentText } from "@material-ui/core";
import ActionDialog from "@saleor/components/ActionDialog";
import { ConfirmButtonTransitionState } from "@saleor/macaw-ui";
import React from "react";
import { FormattedMessage, useIntl } from "react-intl";
export interface AttributeValueDeleteDialogProps {
attributeName: string;
confirmButtonState: ConfirmButtonTransitionState;
open: boolean;
name: string;
useName?: boolean;
onConfirm: () => void;
onClose: () => void;
}
const AttributeValueDeleteDialog: React.FC<AttributeValueDeleteDialogProps> = ({
attributeName,
name,
confirmButtonState,
useName,
onClose,
onConfirm,
open,
}) => {
const intl = useIntl();
return (
<ActionDialog
open={open}
onClose={onClose}
confirmButtonState={confirmButtonState}
onConfirm={onConfirm}
variant="delete"
title={intl.formatMessage({
id: "WWV8aZ",
defaultMessage: "Delete attribute value",
description: "dialog title",
})}
>
<DialogContentText>
{useName ? (
<FormattedMessage
id="no3Ygn"
defaultMessage='Are you sure you want to delete "{name}" value? If you delete it you wont be able to assign it to any of the products with "{attributeName}" attribute.'
values={{
attributeName,
name,
}}
/>
) : (
<FormattedMessage
id="JyQoES"
defaultMessage='Are you sure you want to delete "{name}" value?'
description="delete attribute value"
values={{
name,
}}
/>
)}
</DialogContentText>
</ActionDialog>
);
};
AttributeValueDeleteDialog.displayName = "AttributeValueDeleteDialog";
export default AttributeValueDeleteDialog;