"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.EmptyContainer = EmptyContainer;
const jsx_runtime_1 = require("react/jsx-runtime");
const icons_1 = require("@gravity-ui/icons");
const uikit_1 = require("@gravity-ui/uikit");
const cn_1 = require("../../../utils/cn.js");
const Suggestions_1 = require("../../molecules/Suggestions/index.js");
const i18n_1 = require("./i18n/index.js");
require("./EmptyContainer.css");
const b = (0, cn_1.block)('empty-container');
/**
 * EmptyContainer component - displays a welcome screen with image, title, description,
 * and suggestions
 *
 * @param props - Component props
 * @returns React component
 */
function EmptyContainer(props) {
    const { image, title, description, suggestionTitle, suggestions = [], onSuggestionClick, alignment, layout = 'grid', wrapText = false, showMore, showMoreText, className, qa, } = props;
    const hasContent = title || description || (suggestions && suggestions.length > 0);
    // Define alignment for each element
    const imageAlignment = (alignment === null || alignment === void 0 ? void 0 : alignment.image) || 'left';
    const titleAlignment = (alignment === null || alignment === void 0 ? void 0 : alignment.title) || 'left';
    const descriptionAlignment = (alignment === null || alignment === void 0 ? void 0 : alignment.description) || 'left';
    // Define text for "Show more" button with localization support
    const showMoreButtonText = showMoreText || (0, i18n_1.i18n)('show-more-button');
    return ((0, jsx_runtime_1.jsx)("div", { className: b(null, className), "data-qa": qa, children: (0, jsx_runtime_1.jsx)("div", { className: b('content'), children: hasContent && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: b('welcome-section'), children: [image && ((0, jsx_runtime_1.jsx)("div", { className: b('image-container', { align: imageAlignment }), children: image })), (0, jsx_runtime_1.jsxs)("div", { className: b('text-container'), children: [title && ((0, jsx_runtime_1.jsx)(uikit_1.Text, { variant: "header-2", className: b('title', { align: titleAlignment }), children: title })), description && ((0, jsx_runtime_1.jsx)(uikit_1.Text, { variant: "body-2", color: "complementary", className: b('description', { align: descriptionAlignment }), children: description }))] })] }), suggestions && suggestions.length > 0 && onSuggestionClick && ((0, jsx_runtime_1.jsxs)("div", { className: b('suggestions-section'), children: [suggestionTitle && ((0, jsx_runtime_1.jsx)("div", { className: b('suggestions-title'), children: typeof suggestionTitle === 'string' ? ((0, jsx_runtime_1.jsx)(uikit_1.Text, { variant: "subheader-3", color: "primary", children: suggestionTitle })) : (suggestionTitle) })), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(Suggestions_1.Suggestions, { items: suggestions, onClick: onSuggestionClick, layout: layout, wrapText: wrapText }) }), showMore && ((0, jsx_runtime_1.jsx)("div", { className: b('show-more'), children: (0, jsx_runtime_1.jsxs)(uikit_1.Button, { view: "flat-secondary", size: "l", onClick: showMore, className: b('show-more-button'), children: [(0, jsx_runtime_1.jsx)(uikit_1.Button.Icon, { children: (0, jsx_runtime_1.jsx)(icons_1.ArrowRotateRight, {}) }), showMoreButtonText] }) }))] }))] })) }) }));
}
//# sourceMappingURL=EmptyContainer.js.map
