import { jsx, jsxs } from "react/jsx-runtime";
import {
  __experimentalToggleGroupControl as ToggleGroupControl,
  __experimentalToggleGroupControlOption as ToggleGroupControlOption
} from "@wordpress/components";
import { __ } from "@wordpress/i18n";
function InheritControl({ value, onChange, label }) {
  return /* @__PURE__ */ jsxs(
    ToggleGroupControl,
    {
      __next40pxDefaultSize: true,
      __nextHasNoMarginBottom: true,
      label,
      isBlock: true,
      onChange: (newValue) => {
        onChange({
          inherit: newValue === "default",
          // When enabling inherit, hierarchical is not supported.
          ...newValue === "default" ? { showNested: false } : {}
        });
      },
      help: value ? __(
        "Display terms based on the current taxonomy archive. For hierarchical taxonomies, shows direct children of the current term. For non-hierarchical taxonomies, shows all terms."
      ) : __("Display terms based on specific criteria."),
      value: value ? "default" : "custom",
      children: [
        /* @__PURE__ */ jsx(
          ToggleGroupControlOption,
          {
            value: "default",
            label: __("Default")
          }
        ),
        /* @__PURE__ */ jsx(ToggleGroupControlOption, { value: "custom", label: __("Custom") })
      ]
    }
  );
}
export {
  InheritControl as default
};
//# sourceMappingURL=inherit-control.js.map
