You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
743 B
35 lines
743 B
2 years ago
|
import { forwardRef, useMemo } from 'react';
|
||
|
|
||
|
import ConfirmDialog from './ConfirmDialog';
|
||
|
|
||
|
const FormDialog = forwardRef<
|
||
|
ConfirmDialogForwardedRefContent,
|
||
|
ConfirmDialogProps
|
||
|
>((props, ref) => {
|
||
|
const { scrollContent: isScrollContent } = props;
|
||
|
|
||
|
const scrollBoxPaddingRight = useMemo(
|
||
|
() => (isScrollContent ? '.5em' : undefined),
|
||
|
[isScrollContent],
|
||
|
);
|
||
|
|
||
|
return (
|
||
|
<ConfirmDialog
|
||
|
dialogProps={{
|
||
|
PaperProps: { sx: { minWidth: { xs: '90%', md: '50em' } } },
|
||
|
}}
|
||
|
formContent
|
||
|
scrollBoxProps={{
|
||
|
paddingRight: scrollBoxPaddingRight,
|
||
|
paddingTop: '.3em',
|
||
|
}}
|
||
|
{...props}
|
||
|
ref={ref}
|
||
|
/>
|
||
|
);
|
||
|
});
|
||
|
|
||
|
FormDialog.displayName = 'FormDialog';
|
||
|
|
||
|
export default FormDialog;
|