import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
import { useState } from 'react';
import './style.scss';
import { GetSvgIcon, ToggleComponent } from '..';
const DropdownComponent = ({ props = {}, style = {}, children, text, toggleText, showToggle = true, toggleOnClicked = () => false, }) => {
    const [handleCheveronDown, setHandleCheveronDown] = useState(true);
    const [toggleClicked, setToggleClicked] = useState(false);
    const handleToggleSwitch = () => {
        setToggleClicked((prev) => !prev);
        toggleOnClicked();
    };
    return (_jsxs(_Fragment, { children: [handleCheveronDown && (_jsx("div", { className: 'dropdownComponent--Generic', style: style, ...props, children: _jsxs("button", { onClick: () => {
                        setHandleCheveronDown((prev) => !prev);
                    }, children: [text, _jsx(GetSvgIcon, { iconType: "cheveronDown", iconSize: "28" })] }) })), !handleCheveronDown && (_jsxs("span", { className: "dropdownheader--dropdown-AdvancedFilter--Generic", children: [_jsxs("span", { className: "dropdownheader--dropdown-AdvancedFilter", style: showToggle ? { paddingTop: '0px !important' } : {}, children: [_jsx("span", { className: "titleText--dropdown-AdvancedFilter", children: text }), _jsxs("span", { className: toggleClicked ? `actionsFilters-group toggleClicked--AdvancedFilterSearch` : 'actionsFilters-group', children: [showToggle && (_jsxs("span", { className: "dropdownheader-toogle-container", children: [_jsx(ToggleComponent, { initialState: toggleClicked, sizeVariant: "sm", onClick: handleToggleSwitch }), _jsx("span", { children: toggleText })] })), _jsx("button", { onClick: () => {
                                            setHandleCheveronDown((prev) => !prev);
                                        }, children: _jsx(GetSvgIcon, { iconType: 'cheveronUp', iconSize: "28" }) })] })] }), _jsx("div", { className: "dropdown-children", children: children })] }))] }));
};
export default DropdownComponent;
