import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useState } from 'react';
import GetSvgIcon from '../GetSvgIcon';
import DropdownComponent from '../DropdownComponent';
import './style.scss';
const SearchLocationDropdown = ({ selectedLocation = 'Current', setSelectedLocation }) => {
    const [dropdownActive, setDropdownActive] = useState(false);
    return (_jsxs("div", { className: 'searchLocationDropdown--Generic', children: [_jsx("p", { children: selectedLocation }), _jsx("button", { className: 'searchLocationDropdown--Button', onClick: () => setDropdownActive(prev => !prev), children: _jsx(GetSvgIcon, { iconType: 'cheveronDown', iconSize: '18' }) }), dropdownActive && _jsx(DropdownComponent, { className: 'searchLocationDropdown--Dropdown--Wrapper', children: _jsx("button", { className: 'searchLocationDropdown--Dropdown--Button', onClick: () => {
                        setSelectedLocation(selectedLocation);
                        setDropdownActive(false);
                    }, children: selectedLocation === 'Current' ? 'Previous' : 'Current' }) })] }));
};
export default SearchLocationDropdown;
