"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WelcomeScreen = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const ContentState_1 = require("../ContentState");
const Loader_1 = require("../Loader");
const hooks_1 = require("./hooks");
const styles_1 = require("./styles");
const WelcomeScreen = ({ logo, productName, userName, errorMsg, isSuccess, isLoading, isError, children, onRetry, }) => {
    const { isShowLoader, isShowGreetings, isShowContent } = (0, hooks_1.useLogic)({
        isSuccess,
        isLoading,
        isError,
    });
    return ((0, jsx_runtime_1.jsxs)(ContentState_1.ContentState, { isLoading: isLoading, isError: isError, loadingContent: 
        // Лоадер отображается с задержкой, указанной в константе LOADING_DISPLAY_DELAY_MS
        // biome-ignore lint/complexity/noUselessFragments: Фрагмент необходим по типизации
        isShowLoader ? (0, jsx_runtime_1.jsx)(Loader_1.Loader, {}) : (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}), errorState: { errorList: [errorMsg || ''], onRetry }, children: [isShowGreetings && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(styles_1.FirstStep, { children: (0, jsx_runtime_1.jsxs)(styles_1.ProductWrapper, { children: [logo, productName] }) }), (0, jsx_runtime_1.jsxs)(styles_1.LastStep, { children: [(0, jsx_runtime_1.jsxs)(styles_1.ProductWrapper, { children: [logo, productName] }), (0, jsx_runtime_1.jsxs)(styles_1.GreetingWrapper, { children: [(0, jsx_runtime_1.jsxs)(styles_1.Greeting, { variant: "h2", color: "grey", colorIntensity: "500", children: ["\u0414\u043E\u0431\u0440\u043E \u043F\u043E\u0436\u0430\u043B\u043E\u0432\u0430\u0442\u044C", userName ? ',' : ''] }), userName && ((0, jsx_runtime_1.jsx)(styles_1.UserName, { variant: "h1", color: "textSecondary", children: userName }))] })] })] })), isShowContent && (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children })] }));
};
exports.WelcomeScreen = WelcomeScreen;
