import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import { ProductsFillMd } from '../../icons/ProductsFillMd';
import { IconButton } from '../IconButton';
import { Content } from './Content';
import { StyledMenu } from './styles';
import { useLogic } from './useLogic';
export const ProductSwitcher = (props) => {
    const { anchorRef, openMenu, closeMenu, isLoading, isError, products, open } = useLogic(props);
    return (_jsxs(_Fragment, { children: [_jsx(IconButton, { ref: anchorRef, variant: "text", selected: open, onClick: openMenu, children: _jsx(ProductsFillMd, {}) }), _jsx(StyledMenu, { open: open, anchorEl: anchorRef.current, onClose: closeMenu, children: _jsx(Content, { isLoading: isLoading, isError: isError, products: products }) })] }));
};
