e5f41731ae
* bootstrap next app + add overview page * fix AssetList type * fix up nav stuff * Refactor Nav component and add network components pages * Refactor WorldMap component and update TelegramIcon, GitHubIcon, NymVpnIcon, DiscordIcon, and TwitterIcon components * add service providers page * mixnodes page * delegations page + use material react table for all tables * nodes map page * Refactor StyledLink component and remove unnecessary console.log statements * Refactor ESLint configuration, remove unused dependencies, and update component imports * update deps * Refactor imports and update dependencies * fix dark mode * build single mixnode page * build single gateway page * Refactor handleOnDelegate function to use useCallback in mixnodes page.tsx * Add defaults for constants --------- Co-authored-by: Mark Sinclair <mmsinclair@users.noreply.github.com>
29 lines
953 B
TypeScript
29 lines
953 B
TypeScript
import React from 'react';
|
|
import { Box, Button, Modal, SxProps, Typography } from '@mui/material';
|
|
import { modalStyle } from './SimpleModal';
|
|
|
|
export const ErrorModal: FCWithChildren<{
|
|
open: boolean;
|
|
title?: string;
|
|
message?: string;
|
|
sx?: SxProps;
|
|
backdropProps?: object;
|
|
onClose: () => void;
|
|
children?: React.ReactNode;
|
|
}> = ({ children, open, title, message, sx, backdropProps, onClose }) => (
|
|
<Modal open={open} onClose={onClose} BackdropProps={backdropProps}>
|
|
<Box sx={{ ...modalStyle(), ...sx }} textAlign="center">
|
|
<Typography color={(theme) => theme.palette.error.main} mb={1}>
|
|
{title || 'Oh no! Something went wrong...'}
|
|
</Typography>
|
|
<Typography my={5} color="text.primary" sx={{ textOverflow: 'wrap', overflowWrap: 'break-word' }}>
|
|
{message}
|
|
</Typography>
|
|
{children}
|
|
<Button variant="contained" onClick={onClose}>
|
|
Close
|
|
</Button>
|
|
</Box>
|
|
</Modal>
|
|
);
|