1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import React from "react";
6 import { Dispatch } from "redux";
7 import { connect } from "react-redux";
8 import { RootState } from 'store/store';
9 import { withDialog, WithDialogProps } from "store/dialog/with-dialog";
10 import { NOT_FOUND_DIALOG_NAME } from 'store/not-found-panel/not-found-panel-action';
11 import { CustomStyleRulesCallback } from 'common/custom-theme';
12 import { Dialog, DialogContent, DialogActions, Button } from '@mui/material';
13 import { WithStyles } from '@mui/styles';
14 import withStyles from '@mui/styles/withStyles';
15 import { ArvadosTheme } from 'common/custom-theme';
16 import { NotFoundPanel } from "views/not-found-panel/not-found-panel";
18 type CssRules = 'tag';
20 const styles: CustomStyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
22 marginRight: theme.spacing(1),
23 marginBottom: theme.spacing(1)
27 interface NotFoundDialogDataProps {
31 interface NotFoundDialogActionProps {
35 const mapStateToProps = (state: RootState): NotFoundDialogDataProps => ({
39 const mapDispatchToProps = (dispatch: Dispatch): NotFoundDialogActionProps => ({
43 type NotFoundDialogProps = NotFoundDialogDataProps & NotFoundDialogActionProps & WithDialogProps<{}> & WithStyles<CssRules>;
45 export const NotFoundDialog = connect(mapStateToProps, mapDispatchToProps)(
47 withDialog(NOT_FOUND_DIALOG_NAME)(
48 ({ open, closeDialog }: NotFoundDialogProps) =>
56 <NotFoundPanel notWrapped />
62 onClick={closeDialog}>