// Copyright (C) The Arvados Authors. All rights reserved. // // SPDX-License-Identifier: AGPL-3.0 import * as 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" | "formContainer" | "dialogTitle" | "progressIndicator" | "dialogActions"; const styles: StyleRulesCallback = theme => ({ button: { marginLeft: theme.spacing.unit }, lastButton: { marginLeft: theme.spacing.unit, marginRight: "0", }, 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; enableWhenPristine?: boolean; } type DialogProjectProps = DialogProjectDataProps & WithDialogProps<{}> & InjectedFormProps & WithStyles; export const FormDialog = withStyles(styles)((props: DialogProjectProps) =>
{props.dialogTitle}
);