2019-09-30 10:32:00 +00:00
|
|
|
import DialogContentText from "@material-ui/core/DialogContentText";
|
|
|
|
import ActionDialog from "@saleor/components/ActionDialog";
|
|
|
|
import { ConfirmButtonTransitionState } from "@saleor/components/ConfirmButton";
|
2020-05-14 09:30:32 +00:00
|
|
|
import React from "react";
|
|
|
|
import { FormattedMessage, useIntl } from "react-intl";
|
2019-09-30 10:32:00 +00:00
|
|
|
|
|
|
|
export interface ServiceTokenDeleteDialogProps {
|
|
|
|
confirmButtonState: ConfirmButtonTransitionState;
|
|
|
|
open: boolean;
|
|
|
|
onConfirm: () => void;
|
|
|
|
onClose: () => void;
|
|
|
|
name: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
const ServiceTokenDeleteDialog: React.FC<ServiceTokenDeleteDialogProps> = ({
|
|
|
|
name,
|
|
|
|
confirmButtonState,
|
|
|
|
onClose,
|
|
|
|
onConfirm,
|
|
|
|
open
|
|
|
|
}) => {
|
|
|
|
const intl = useIntl();
|
|
|
|
|
|
|
|
return (
|
|
|
|
<ActionDialog
|
|
|
|
open={open}
|
|
|
|
onClose={onClose}
|
|
|
|
confirmButtonState={confirmButtonState}
|
|
|
|
onConfirm={onConfirm}
|
|
|
|
variant="delete"
|
|
|
|
title={intl.formatMessage({
|
|
|
|
defaultMessage: "Delete Service Account",
|
|
|
|
description: "dialog title"
|
|
|
|
})}
|
|
|
|
>
|
|
|
|
<DialogContentText>
|
|
|
|
<FormattedMessage
|
|
|
|
defaultMessage="Are you sure you want to delete token {token}?"
|
|
|
|
description="delete token"
|
|
|
|
values={{
|
|
|
|
token: <strong>{name}</strong>
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</DialogContentText>
|
|
|
|
</ActionDialog>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
ServiceTokenDeleteDialog.displayName = "ServiceTokenDeleteDialog";
|
|
|
|
export default ServiceTokenDeleteDialog;
|