mirror of
https://git.netzspielplatz.de/docker-multiarch/openwrt-firmware-selector.git
synced 2025-11-08 18:59:27 +00:00
Add prettier and bind it with eslint. Also add pre-commit hook to prettify before commit Signed-off-by: Sudhanshu Gautam <me@sudhanshug.com>
65 lines
1.4 KiB
JavaScript
65 lines
1.4 KiB
JavaScript
import {
|
|
Button,
|
|
Dialog,
|
|
DialogActions,
|
|
DialogContent,
|
|
DialogContentText,
|
|
DialogTitle,
|
|
} from '@material-ui/core';
|
|
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
|
|
function AlertDialog({
|
|
open,
|
|
cancelHandler,
|
|
acceptHandler,
|
|
body,
|
|
title,
|
|
cancelComponent,
|
|
acceptComponent,
|
|
}) {
|
|
return (
|
|
<Dialog
|
|
open={open}
|
|
onClose={cancelHandler}
|
|
aria-labelledby="alert-dialog-title"
|
|
aria-describedby="alert-dialog-description"
|
|
>
|
|
<DialogTitle id="alert-dialog-title">{title}</DialogTitle>
|
|
<DialogContent>
|
|
<DialogContentText id="alert-dialog-description">
|
|
{body}
|
|
</DialogContentText>
|
|
</DialogContent>
|
|
<DialogActions>
|
|
{acceptHandler && (
|
|
<Button onClick={acceptHandler} color="primary">
|
|
{acceptComponent}
|
|
</Button>
|
|
)}
|
|
{cancelHandler && (
|
|
<Button
|
|
onClick={cancelHandler}
|
|
color="secondary"
|
|
variant="contained"
|
|
autoFocus
|
|
>
|
|
{cancelComponent}
|
|
</Button>
|
|
)}
|
|
</DialogActions>
|
|
</Dialog>
|
|
);
|
|
}
|
|
|
|
AlertDialog.propTypes = {
|
|
open: PropTypes.bool,
|
|
cancelHandler: PropTypes.func,
|
|
acceptHandler: PropTypes.func,
|
|
body: PropTypes.object,
|
|
title: PropTypes.string,
|
|
cancelComponent: PropTypes.elementType,
|
|
acceptComponent: PropTypes.object,
|
|
};
|
|
|
|
export default AlertDialog;
|