1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import React from 'react';
6 import { Dialog, DialogTitle, Button, Grid, DialogContent, CircularProgress, Paper } from '@material-ui/core';
7 import { DialogActions } from 'components/dialog-actions/dialog-actions';
8 import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles';
11 export interface SharingDialogDataProps {
15 advancedEnabled: boolean;
16 children: React.ReactNode;
18 export interface SharingDialogActionProps {
22 onAdvanced: () => void;
24 export default (props: SharingDialogDataProps & SharingDialogActionProps) => {
25 const { children, open, loading, advancedEnabled, saveEnabled, onAdvanced, onClose, onExited, onSave } = props;
27 {...{ open, onClose, onExited }}
28 className="sharing-dialog"
40 <Grid container spacing={8}>
52 <Button onClick={onClose}>
61 disabled={!saveEnabled}>
68 loading && <LoadingIndicator />
73 const loadingIndicatorStyles: StyleRulesCallback<'root'> = theme => ({
82 justifyContent: 'center',
83 backgroundColor: 'rgba(255, 255, 255, 0.8)',
87 const LoadingIndicator = withStyles(loadingIndicatorStyles)(
88 (props: WithStyles<'root'>) =>
89 <Paper classes={props.classes}>