import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import GetSvgIcon from '../GetSvgIcon';
import PrimaryButton from '../PrimaryButton';
import TertiaryButton from '../TertiaryButton';
import './style.scss';
import { useEffect } from 'react';
const ChatDialogBoxPopup = ({ text = 'Hi! this is a single line...', subText = '', icon = 'passTick', buttons, isOpen = true, position = 'center', }) => {
    useEffect(() => {
        const dialog = document.getElementById('dialog');
        if (dialog) {
            if (isOpen) {
                dialog.showModal();
            }
            else {
                dialog.close();
            }
        }
    }, [isOpen]);
    return (_jsx("dialog", { id: "dialog", children: _jsxs("div", { className: `chat-dialogbox-popup  ${position}`, children: [_jsx("span", { className: "icon", children: _jsx(GetSvgIcon, { iconType: icon, iconSize: "40" }) }), _jsx("span", { children: text }), _jsx("span", { className: "subText", children: subText }), typeof buttons === 'undefined' ? (_jsx("span", {})) : buttons.primaryButton && buttons.tertairyButton ? (_jsxs("span", { className: "two-buttons", children: [_jsx(TertiaryButton, { text: buttons.tertairyButton.text, sizeVariant: buttons.tertairyButton.sizeVariant, onClick: buttons.tertairyButton.onClick }), _jsx(PrimaryButton, { text: buttons.primaryButton.text, colorVariant: buttons.primaryButton.colorVariant, sizeVariant: buttons.primaryButton.sizeVariant, onClick: buttons.primaryButton.onClick })] })) : buttons.primaryButton ? (_jsx("span", { className: "one-button", children: _jsx(PrimaryButton, { text: buttons.primaryButton.text, colorVariant: buttons.primaryButton.colorVariant, sizeVariant: buttons.primaryButton.sizeVariant, onClick: buttons.primaryButton.onClick }) })) : buttons.tertairyButton ? (_jsx("span", { className: "one-button", children: _jsx(TertiaryButton, { text: buttons.tertairyButton.text, sizeVariant: buttons.tertairyButton.sizeVariant, onClick: buttons.tertairyButton.onClick }) })) : (_jsx("span", {}))] }) }));
};
export default ChatDialogBoxPopup;
