import 'core-js/modules/es.object.assign.js';
import { __rest } from '../../../_virtual/_tslib.js';
import { jsxs, jsx } from 'react/jsx-runtime';
import { Card, CardHeader, CardContent } from '@mui/material';
import { IconButton } from '../../atom/Button/IconButton.js';
import { IconFont } from '../../atom/IconFont/IconFont.js';

const Modal = _a => {
  var {
      header,
      className,
      contentClassName,
      headerClassName,
      children,
      handleClose
    } = _a,
    props = __rest(_a, ["header", "className", "contentClassName", "headerClassName", "children", "handleClose"]);
  return jsxs(Card, Object.assign({
    variant: "outlined",
    className: className,
    sx: {
      padding: '16px',
      color: 'primary.main',
      backgroundColor: 'primary.dark'
    },
    onClick: e => {
      e.stopPropagation();
    }
  }, props, {
    children: [jsx(CardHeader, {
      action: handleClose != null && jsx(IconButton, Object.assign({
        "aria-label": "close",
        variant: "text",
        color: "primary",
        onClick: handleClose
      }, {
        children: jsx(IconFont, {
          name: "close"
        })
      })),
      title: header,
      className: headerClassName
    }), jsx(CardContent, Object.assign({
      className: contentClassName
    }, {
      children: children
    }))]
  }));
};

export { Modal, Modal as default };
