dyomedea/src/components/dialog/Dialog.tsx

47 lines
1.1 KiB
TypeScript

import { Component, JSXElement } from 'solid-js';
import {
Dialog as MuiDialog,
DialogContent,
DialogTitle,
Grid,
IconButton,
} from '@suid/material';
import CloseIcon from '@suid/icons-material/Close';
const Dialog: Component<{
open: boolean;
fullScreen?: boolean;
title: JSXElement;
closeHandler: (event: any, reason?: string) => void;
children: JSXElement;
}> = (props) => {
return (
<MuiDialog
onClose={props.closeHandler}
open={props.open}
PaperProps={{ sx: { minWidth: '300px' } }}
fullScreen={props.fullScreen}
>
<DialogTitle
sx={{
backgroundColor: 'rgba(14, 116, 144, 0.7)',
color: 'white',
clear: 'both',
margin: '0',
paddingLeft: '0',
}}
>
<IconButton onClick={props.closeHandler}>
<CloseIcon />
</IconButton>
{props.title}
</DialogTitle>
<DialogContent sx={{ width: 'calc(100% - 60px)' }}>
{props.children}
</DialogContent>
</MuiDialog>
);
};
export default Dialog;