import { __rest } from "tslib";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import React from 'react';
import { FormattedMessage } from 'react-intl';
import { Box, DialogTitle, IconButton, List, ListItem, ListItemButton, ListItemText, Typography, } from '@mui/material';
import { styled } from '@mui/material/styles';
import Icon from '@mui/material/Icon';
import DialogContent from '@mui/material/DialogContent';
import classNames from 'classnames';
import { PREFIX } from '../../constants';
const classes = {
    root: `${PREFIX}-layer-close-root`,
    title: `${PREFIX}-layer-title`,
    content: `${PREFIX}-layer-content`
};
const Root = styled(Box, {
    name: PREFIX,
    slot: 'LayerCloseRoot'
})(() => ({}));
const CloseLayer = React.forwardRef((props, ref) => {
    // Props
    const { className, onClose, onSave, defaultValue = [] } = props, rest = __rest(props, ["className", "onClose", "onSave", "defaultValue"]);
    return _jsxs(Root, Object.assign({ ref: ref, className: classNames(className, classes.root) }, rest, { children: [_jsxs(DialogTitle, Object.assign({ className: classes.title }, { children: [_jsx(IconButton, Object.assign({ onClick: onClose }, { children: _jsx(Icon, { children: "arrow_back" }) })), _jsx(Typography, { children: _jsx(FormattedMessage, { id: "ui.composer.layer.close.title", defaultMessage: "ui.composer.layer.close.title" }) })] })), _jsxs(DialogContent, Object.assign({ className: classes.content }, { children: [_jsx(Typography, { children: _jsx(FormattedMessage, { id: "ui.composer.layer.close.text", defaultMessage: "ui.composer.layer.close.text" }) }), _jsxs(List, { children: [_jsx(ListItem, { children: _jsx(ListItemButton, Object.assign({ onClick: onClose }, { children: _jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.composer.layer.close.no", defaultMessage: "ui.composer.layer.close.no" }) }) })) }), _jsx(ListItem, { children: _jsx(ListItemButton, Object.assign({ onClick: onSave }, { children: _jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.composer.layer.close.yes", defaultMessage: "ui.composer.layer.close.yes" }) }) })) })] })] }))] }));
});
export default CloseLayer;
