Skip to content

Commit

Permalink
tailwinds #5005
Browse files Browse the repository at this point in the history
  • Loading branch information
rithviknishad committed Jun 13, 2023
1 parent 5ee4f15 commit 08ca3cb
Showing 1 changed file with 14 additions and 40 deletions.
54 changes: 14 additions & 40 deletions src/Components/Users/UserDeleteDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import React, { useState } from "react";
import {
Dialog,
DialogContent,
DialogContentText,
DialogActions,
Button,
} from "@material-ui/core";
import ConfirmDialogV2 from "../Common/ConfirmDialogV2";

interface ConfirmDialogProps {
name: string;
Expand All @@ -14,39 +7,20 @@ interface ConfirmDialogProps {
}

const UserDeleteDialog = (props: ConfirmDialogProps) => {
const { name, handleCancel, handleOk } = props;

const [disable, setDisable] = useState(false);

const handleSubmit = () => {
handleOk();
setDisable(true);
};
return (
<Dialog open={true} maxWidth={"md"} onClose={handleCancel}>
<DialogContent>
<DialogContentText
id="alert-dialog-description"
className="flex text-gray-800 leading-relaxed"
>
<div className="justify-center">
Are you sure you want to delete user <strong>{name}</strong> ?
</div>
</DialogContentText>
</DialogContent>
<DialogActions>
<Button onClick={handleCancel} color="primary">
Cancel
</Button>
<button
onClick={handleSubmit}
className="font-medium btn btn-danger"
disabled={disable}
>
Delete
</button>
</DialogActions>
</Dialog>
<ConfirmDialogV2
title="Delete User"
description={
<span>
Are you sure you want to delete user <strong>{props.name}</strong> ?
</span>
}
action="Delete"
variant="danger"
show
onConfirm={props.handleOk}
onClose={props.handleCancel}
/>
);
};

Expand Down

0 comments on commit 08ca3cb

Please sign in to comment.