mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
27 lines
725 B
TypeScript
27 lines
725 B
TypeScript
// @ts-nocheck
|
|
import React from 'react';
|
|
import { Dialog } from '@blueprintjs/core';
|
|
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
|
import { compose } from '@/utils';
|
|
|
|
import '@/style/components/Dialog/Dialog.scss';
|
|
import { DialogProvider } from './DialogProvider';
|
|
|
|
function DialogComponent(props) {
|
|
const { name, children, closeDialog, onClose } = props;
|
|
|
|
const handleClose = (event) => {
|
|
closeDialog(name);
|
|
onClose && onClose(event);
|
|
};
|
|
return (
|
|
<Dialog {...props} onClose={handleClose}>
|
|
<DialogProvider value={props}>{children}</DialogProvider>
|
|
</Dialog>
|
|
);
|
|
}
|
|
|
|
const DialogRoot = compose(withDialogActions)(DialogComponent);
|
|
|
|
export { DialogRoot as Dialog };
|