// Copyright (C) The Arvados Authors. All rights reserved. // // SPDX-License-Identifier: AGPL-3.0 import React from 'react'; import { InjectedFormProps } from 'redux-form'; import { Dialog, DialogActions, DialogContent, DialogTitle } from '@material-ui/core/'; import { Button, StyleRulesCallback, WithStyles, withStyles, CircularProgress } from '@material-ui/core'; import { WithDialogProps } from 'store/dialog/with-dialog'; type CssRules = "button" | "lastButton" | "form" | "formContainer" | "dialogTitle" | "progressIndicator" | "dialogActions"; const styles: StyleRulesCallback = theme => ({ button: { marginLeft: theme.spacing.unit }, lastButton: { marginLeft: theme.spacing.unit, marginRight: "0", }, form: { display: 'flex', overflowY: 'auto', flexDirection: 'column', flex: '0 1 auto', }, formContainer: { display: "flex", flexDirection: "column", paddingBottom: "0", }, dialogTitle: { paddingTop: theme.spacing.unit, paddingBottom: theme.spacing.unit, }, progressIndicator: { position: "absolute", minWidth: "20px", }, dialogActions: { marginBottom: theme.spacing.unit, marginRight: theme.spacing.unit * 3, } }); interface DialogProjectDataProps { cancelLabel?: string; dialogTitle: string; formFields: React.ComponentType & WithDialogProps>; submitLabel?: string; cancelCallback?: Function; enableWhenPristine?: boolean; doNotDisableCancel?: boolean; } type DialogProjectProps = DialogProjectDataProps & WithDialogProps<{}> & InjectedFormProps & WithStyles; export const FormDialog = withStyles(styles)((props: DialogProjectProps) =>
{props.dialogTitle}
);