"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MobilePageActions = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const PageActions_1 = require("../PageActions");
const styles_1 = require("./styles");
const useLogic_1 = require("./useLogic");
const MobilePageActions = (props) => {
    const { disabledAction, isActive, handleToggle, visibleMainActions, hiddenMainActions, isVisibleShowMoreButton, isLoading, } = (0, useLogic_1.useLogic)(props);
    const { secondary, secondaryVisible, className } = props;
    if (isLoading) {
        return null;
    }
    return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { className: className, role: "presentation", children: [(0, jsx_runtime_1.jsxs)(styles_1.ActionWrapper, { children: [(0, jsx_runtime_1.jsx)(styles_1.StyledMainActions, { actions: visibleMainActions, isDisabled: disabledAction, "$isVisibleShowMoreButton": isVisibleShowMoreButton, size: "large" }), (0, jsx_runtime_1.jsxs)(styles_1.StyledCollapse, { in: isActive, children: [(0, jsx_runtime_1.jsx)(PageActions_1.MainActions, { isDisabled: disabledAction, actions: hiddenMainActions, size: "large" }), (0, jsx_runtime_1.jsxs)(styles_1.SecondaryActionsWrapper, { children: [secondaryVisible && ((0, jsx_runtime_1.jsx)(PageActions_1.SecondaryVisibleActions, { actions: secondaryVisible, size: "large" })), secondary && ((0, jsx_runtime_1.jsx)(PageActions_1.SecondaryActions, { isDisabled: disabledAction, actions: secondary, size: "large" }))] })] })] }), isVisibleShowMoreButton && ((0, jsx_runtime_1.jsx)(styles_1.ShowMoreButton, { onClick: handleToggle, children: isActive ? 'Скрыть другие действия' : 'Показать другие действия' }))] }));
};
exports.MobilePageActions = MobilePageActions;
