import React, { useCallback } from 'react';
import { Button, ModalWrapper } from "../../modules";
import { BUTTON_PULSE_TYPE, BUTTON_SIZE } from "../../constants";
import { FONT_VARIANTS } from "../../globalStyled";
import { ConfirmModalDiv, ConfirmText } from './styled';
export const ConfirmModal = ({ title = 'Вы уверены?', text, onClose, onConfirm, buttonText, buttonClose = 'отмена', windowLevel, }) => {
    const { secondary } = BUTTON_PULSE_TYPE;
    const { body2Regular } = FONT_VARIANTS;
    const actionBar = useCallback(() => (React.createElement(React.Fragment, null,
        React.createElement(Button, { type: secondary, onClick: onClose, size: BUTTON_SIZE.s }, buttonClose),
        React.createElement(Button, { size: BUTTON_SIZE.s, onClick: () => {
                onConfirm();
                onClose();
            } }, buttonText))), []);
    const header = useCallback(() => React.createElement(React.Fragment, null, title), []);
    return (React.createElement(ModalWrapper, { actionBar: actionBar, header: header, windowLevel: windowLevel, onClose: onClose },
        React.createElement(ConfirmModalDiv, null, text && React.createElement(ConfirmText, { variant: body2Regular }, text))));
};
