// packages/block-editor/src/components/global-styles/state-control-badges.js
import { privateApis as componentsPrivateApis } from "@wordpress/components";
import { Stack } from "@wordpress/ui";
import { unlock } from "../../lock-unlock.mjs";
import { jsx } from "react/jsx-runtime";
var { Badge: WCBadge } = unlock(componentsPrivateApis);
function StateControlBadges({
  viewportStates = [],
  pseudoStates = [],
  viewportValue = "default",
  pseudoStateValue = "default",
  className = "block-editor-global-styles-state-control__badges"
}) {
  const activeStates = [];
  const selectedViewport = viewportStates.find(
    (state) => state.value === viewportValue
  );
  const selectedPseudoState = pseudoStates.find(
    (state) => state.value === pseudoStateValue
  );
  if (selectedViewport) {
    activeStates.push({
      key: `viewport-${selectedViewport.value}`,
      label: selectedViewport.label
    });
  }
  if (selectedPseudoState) {
    activeStates.push({
      key: `pseudo-${selectedPseudoState.value}`,
      label: selectedPseudoState.label
    });
  }
  return /* @__PURE__ */ jsx(
    Stack,
    {
      className,
      direction: "row",
      justify: "flex-start",
      gap: "xs",
      wrap: "wrap",
      children: activeStates.map((state) => /* @__PURE__ */ jsx(WCBadge, { intent: "info", children: state.label }, state.key))
    }
  );
}
export {
  StateControlBadges as default
};
//# sourceMappingURL=state-control-badges.mjs.map
