"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProductSwitcher = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const ProductsFillMd_1 = require("../../icons/ProductsFillMd");
const IconButton_1 = require("../IconButton");
const Content_1 = require("./Content");
const styles_1 = require("./styles");
const useLogic_1 = require("./useLogic");
const ProductSwitcher = (props) => {
    const { anchorRef, openMenu, closeMenu, isLoading, isError, products, open } = (0, useLogic_1.useLogic)(props);
    return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { ref: anchorRef, variant: "text", selected: open, onClick: openMenu, children: (0, jsx_runtime_1.jsx)(ProductsFillMd_1.ProductsFillMd, {}) }), (0, jsx_runtime_1.jsx)(styles_1.StyledMenu, { open: open, anchorEl: anchorRef.current, onClose: closeMenu, children: (0, jsx_runtime_1.jsx)(Content_1.Content, { isLoading: isLoading, isError: isError, products: products }) })] }));
};
exports.ProductSwitcher = ProductSwitcher;
