import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
/*
* Copyright (c) 2020-present SMC Treviso s.r.l. All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
import React from "react";
import { css } from "styled-components";
import "overlayscrollbars/css/OverlayScrollbars.css";
import { ModalDetail } from "./ModalDetail";
import { FiltersHorizontalMemo } from "./FiltersHorizontal";
import { FilterSvg } from "../svgElement/FiltersSvg";
import { DeleteLogo } from "./DeleteLogo";
function FiltersMobile({ dynamicFilters, searchQuery, sort, onConfigurationChange, isVisibleFilters, setIsVisibleFilters, language, sortAfterKey, isDynamicElement, selectionsDispatch, numberResultOfFilters, memoryResults, filtersMobileBasicCallback, }) {
    const componet = (_jsxs(React.Fragment, { children: [_jsxs("div", { css: css `
          display: flex;
          justify-content: space-beetween;
          background: white;
        `, children: [_jsx("div", { className: "openk9-filter-list-container-title box-title", css: css `
            padding: 0px 16px;
            width: 100%;
            background: white;
            padding-top: 20px;
            padding-bottom: 13px;
            display: flex;
          `, children: _jsxs("div", { className: "openk9-filter-list-container-internal-title ", css: css `
              display: flex;
              gap: 5px;
            `, children: [_jsx("span", { children: _jsx(FilterSvg, {}) }), _jsx("span", { className: "openk9-filters-list-title title", children: _jsx("h2", { css: css `
                  font-style: normal;
                  font-weight: 700;
                  font-size: 18px;
                  height: 18px;
                  line-height: 22px;
                  display: flex;
                  align-items: center;
                  color: #3f3f46;
                  margin: 0;
                `, children: "Filtri" }) })] }) }), _jsxs("button", { className: "openk9-button-close", css: css `
            color: var(--openk9-grey-stone-600);
            font-size: 10px;
            font-family: Nunito Sans;
            font-weight: 700;
            line-height: 12px;
            display: flex;
            align-items: center;
            gap: 9px;
            margin-right: 21px;
            background-color: white;
            border: none;
          `, onClick: () => {
                            if (setIsVisibleFilters)
                                setIsVisibleFilters(false);
                            filtersMobileBasicCallback && filtersMobileBasicCallback();
                        }, children: ["Chiudi ", _jsx(DeleteLogo, { heightParam: 8, widthParam: 8 })] })] }), _jsx(FiltersHorizontalMemo, { searchQuery: searchQuery, onConfigurationChange: onConfigurationChange, onConfigurationChangeExt: () => {
                    if (setIsVisibleFilters)
                        setIsVisibleFilters(false);
                }, sort: sort, dynamicFilters: dynamicFilters, language: language, sortAfterKey: sortAfterKey, numberOfResults: 10, isDynamicElement: isDynamicElement, selectionsDispatch: selectionsDispatch, numberResultOfFilters: numberResultOfFilters, memoryResults: memoryResults })] }));
    if (!isVisibleFilters)
        return null;
    document.body.style.overflow = "hidden";
    return _jsx(ModalDetail, { padding: "0px", background: "white", content: componet });
}
export const FiltersMobileMemo = React.memo(FiltersMobile);
