import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import ReactMarkdown from "react-markdown";
import { Container, Content, MinorContent, ContentWrapper, Inner, LeftIcon, RightIcon, Close, } from "./banner.styled";
import { Cross } from "./cross";
import Space from "../space";
const Banner = ({ href, enabled, height, background, contentDirection, justify, leftIconSrc, rightIconSrc, content, fontSize, fontColor, textAlign, contentMargin, minorContent, minorFontSize, minorFontColor, minorTextAlign, minorContentMargin, handleCloseClick, handleBannerClick, }) => {
    if (!enabled)
        return null;
    return (_jsx(Container, { className: `ui-banner__container`, height: height, background: background, children: _jsxs(Inner, { className: `ui-banner__inner`, justifyContent: justify, href: href, onClick: (e) => {
                e.preventDefault();
                handleBannerClick && handleBannerClick();
                href &&
                    setTimeout(() => {
                        window.location.href = href;
                    }, 500);
            }, children: [leftIconSrc ? (_jsx(LeftIcon, { className: `ui-banner__left-icon`, src: leftIconSrc, alt: "Banner left icon" })) : (_jsx(Space, { width: 180, widthMobile: 160, height: 0, heightMobile: 0 })), _jsxs(ContentWrapper, { direction: contentDirection, children: [content && (_jsx(Content, { className: `ui-banner__content`, fontSize: fontSize, fontColor: fontColor, textAlign: textAlign, contentMargin: contentMargin, children: _jsx(ReactMarkdown, { children: content }) })), minorContent && (_jsx(MinorContent, { className: `ui-banner__minor-content`, fontSize: minorFontSize, fontColor: minorFontColor, textAlign: minorTextAlign, contentMargin: minorContentMargin, children: _jsx(ReactMarkdown, { children: minorContent }) }))] }), rightIconSrc ? (_jsx(RightIcon, { className: `ui-banner__right-icon`, src: rightIconSrc, alt: "Banner right icon" })) : (_jsx(Space, { width: 180, widthMobile: 160, height: 0, heightMobile: 0 })), handleCloseClick && (_jsx(Close, { className: `ui-banner__close`, onClick: handleCloseClick, children: _jsx(Cross, { color: "#ffffffab" }) }))] }) }));
};
export default Banner;
//# sourceMappingURL=banner.js.map