"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BannerTemplate = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const Button_1 = require("../../Button");
const Typography_1 = require("../../Typography");
const useViewportType_1 = require("../../useViewportType");
const styles_1 = require("./styles");
const BannerTemplate = (props) => {
    const { closeToast, imageSrc, title, description, onClose, action, setIsOpenDialog, } = props;
    const { isMobile } = (0, useViewportType_1.useViewportType)();
    const handleClose = () => {
        closeToast?.();
        onClose?.();
    };
    const handleCloseForAction = () => {
        closeToast?.();
        setIsOpenDialog?.(false);
    };
    return ((0, jsx_runtime_1.jsxs)(styles_1.Container, { children: [imageSrc && (0, jsx_runtime_1.jsx)(styles_1.Image, { src: imageSrc }), (0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { container: true, children: [(0, jsx_runtime_1.jsxs)(styles_1.WrapperTextContent, { container: true, children: [title && (0, jsx_runtime_1.jsx)(Typography_1.Typography, { variant: "h4", children: title }), description && ((0, jsx_runtime_1.jsx)(Typography_1.Typography, { variant: "body1", children: description }))] }), (0, jsx_runtime_1.jsxs)(styles_1.Footer, { children: [!isMobile && ((0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: handleClose, variant: "text", size: "large", children: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C" })), action?.({ closeBanner: handleCloseForAction })] })] })] }));
};
exports.BannerTemplate = BannerTemplate;
