refactor(web): remove typescript
This commit is contained in:
@@ -5,19 +5,7 @@ import DialogActions from '@mui/material/DialogActions';
|
||||
import DialogContent from '@mui/material/DialogContent';
|
||||
import DialogContentText from '@mui/material/DialogContentText';
|
||||
import DialogTitle from '@mui/material/DialogTitle';
|
||||
|
||||
type ConfirmationDialogProps = {
|
||||
onClose: () => void;
|
||||
onConfirm: () => void;
|
||||
title: React.ReactNode;
|
||||
description: React.ReactNode;
|
||||
cancelButtonChildren: React.ReactNode;
|
||||
confirmButtionChildren: React.ReactNode;
|
||||
open?: boolean;
|
||||
'data-test'?: string;
|
||||
}
|
||||
|
||||
export default function ConfirmationDialog(props: ConfirmationDialogProps) {
|
||||
export default function ConfirmationDialog(props) {
|
||||
const {
|
||||
onClose,
|
||||
onConfirm,
|
||||
@@ -30,31 +18,26 @@ export default function ConfirmationDialog(props: ConfirmationDialogProps) {
|
||||
const dataTest = props['data-test'];
|
||||
return (
|
||||
<Dialog open={open} onClose={onClose} data-test={dataTest}>
|
||||
{title && (
|
||||
<DialogTitle>
|
||||
{title}
|
||||
</DialogTitle>
|
||||
)}
|
||||
{title && <DialogTitle>{title}</DialogTitle>}
|
||||
{description && (
|
||||
<DialogContent>
|
||||
<DialogContentText>
|
||||
{description}
|
||||
</DialogContentText>
|
||||
<DialogContentText>{description}</DialogContentText>
|
||||
</DialogContent>
|
||||
)}
|
||||
|
||||
<DialogActions>
|
||||
{(cancelButtonChildren && onClose) && (
|
||||
<Button
|
||||
onClick={onClose}
|
||||
data-test="confirmation-cancel-button">{cancelButtonChildren}</Button>
|
||||
{cancelButtonChildren && onClose && (
|
||||
<Button onClick={onClose} data-test="confirmation-cancel-button">
|
||||
{cancelButtonChildren}
|
||||
</Button>
|
||||
)}
|
||||
|
||||
{(confirmButtionChildren && onConfirm) && (
|
||||
{confirmButtionChildren && onConfirm && (
|
||||
<Button
|
||||
onClick={onConfirm}
|
||||
color="error"
|
||||
data-test="confirmation-confirm-button">
|
||||
data-test="confirmation-confirm-button"
|
||||
>
|
||||
{confirmButtionChildren}
|
||||
</Button>
|
||||
)}
|
Reference in New Issue
Block a user