"use strict";
'use client';
Object.defineProperty(exports, "__esModule", { value: true });
exports.PHXBannerWithCard = void 0;
const tslib_1 = require("tslib");
const react_1 = tslib_1.__importDefault(require("react"));
const Button_1 = require("../Button");
const types_1 = require("../types");
const Icon_1 = tslib_1.__importDefault(require("./Icon"));
const PHXBannerWithCard = ({ action, children, className, dangerAction, description, hideCloseButton = false, onClose, primaryAction, secondaryAction, show, title, type = 'informational', hideIcon = false, }) => {
    const classNameType = (0, types_1.classNames)(type === 'informational' && 'bg-[#EAF4FF] text-[#00527C]', type === 'success' && 'bg-[#CDFEE1] text-[#0C5132]', type === 'warning' && 'bg-[#FFF1E3] text-[#5E4200]', type === 'danger' && 'bg-[#FEE9E8] text-[#8E1F0B]');
    return show ? (react_1.default.createElement("div", { className: (0, types_1.classNames)('rounded-lg p-2 shadow-[0rem_0.0825rem_0rem_#00000012]', classNameType, className) },
        react_1.default.createElement("div", { className: (0, types_1.classNames)('flex items-center justify-between text-xs font-semibold leading-5') },
            react_1.default.createElement("div", { className: 'flex' },
                !hideIcon && (react_1.default.createElement("div", { className: 'flex-shrink-0' },
                    react_1.default.createElement(Icon_1.default, { type: type }))),
                title && react_1.default.createElement("span", null, title),
                !title && description && react_1.default.createElement("div", { className: 'max-w-full text-xs font-normal' }, description)),
            !hideCloseButton && (react_1.default.createElement("button", { className: `rounded-md p-1 hover:bg-[#1a1a1a0d] hover:text-gray-600 ${hideCloseButton ? 'invisible' : ''}`, onClick: onClose, type: 'button' },
                react_1.default.createElement("span", { className: 'sr-only' }, "Close"),
                react_1.default.createElement("svg", { className: 'h-4 w-4', fill: 'none', stroke: 'currentColor', strokeWidth: '2', viewBox: '0 0 24 24', xmlns: 'http://www.w3.org/2000/svg' },
                    react_1.default.createElement("path", { d: 'M6 18L18 6M6 6l12 12', strokeLinecap: 'round', strokeLinejoin: 'round' }))))),
        react_1.default.createElement("div", { className: (0, types_1.classNames)('', !hideCloseButton && 'pr-6', !hideIcon && 'pl-[1.65rem]') },
            title && description && react_1.default.createElement("div", { className: 'max-w-full pt-1 text-xs font-normal' }, description),
            children && react_1.default.createElement("div", { className: 'pt-3' }, children),
            action || primaryAction || secondaryAction || dangerAction ? (react_1.default.createElement("div", { className: 'flex gap-x-2 pt-3' },
                action && (react_1.default.createElement(Button_1.PHXButton, { className: 'font-semibold', disabled: action === null || action === void 0 ? void 0 : action.disabled, loading: action === null || action === void 0 ? void 0 : action.loading, onClick: action.onClick, secondary: true, size: 'small' }, action.content)),
                primaryAction && (react_1.default.createElement(Button_1.PHXButton, { className: 'font-semibold', disabled: primaryAction === null || primaryAction === void 0 ? void 0 : primaryAction.disabled, loading: primaryAction === null || primaryAction === void 0 ? void 0 : primaryAction.loading, onClick: primaryAction.onClick, primary: true, size: 'small' }, primaryAction.content)),
                secondaryAction && (react_1.default.createElement(Button_1.PHXButton, { className: 'font-semibold', disabled: secondaryAction === null || secondaryAction === void 0 ? void 0 : secondaryAction.disabled, loading: secondaryAction === null || secondaryAction === void 0 ? void 0 : secondaryAction.loading, onClick: secondaryAction.onClick, secondary: true, size: 'small' }, secondaryAction.content)),
                dangerAction && (react_1.default.createElement(Button_1.PHXButton, { className: 'font-semibold', disabled: dangerAction === null || dangerAction === void 0 ? void 0 : dangerAction.disabled, loading: dangerAction === null || dangerAction === void 0 ? void 0 : dangerAction.loading, danger2: true, onClick: dangerAction.onClick, size: 'small' }, dangerAction.content)))) : (react_1.default.createElement(react_1.default.Fragment, null))))) : (react_1.default.createElement(react_1.default.Fragment, null));
};
exports.PHXBannerWithCard = PHXBannerWithCard;
//# sourceMappingURL=BannerWithCard.js.map