// packages/editor/src/components/editor-snackbars/index.js
import { SnackbarList } from "@wordpress/components";
import { useSelect, useDispatch } from "@wordpress/data";
import { store as noticesStore } from "@wordpress/notices";
import { jsx } from "react/jsx-runtime";
var MAX_VISIBLE_NOTICES = -3;
function EditorSnackbars() {
  const notices = useSelect(
    (select) => select(noticesStore).getNotices(),
    []
  );
  const { removeNotice } = useDispatch(noticesStore);
  const snackbarNotices = notices.filter(({ type }) => type === "snackbar").slice(MAX_VISIBLE_NOTICES);
  return /* @__PURE__ */ jsx(
    SnackbarList,
    {
      notices: snackbarNotices,
      className: "components-editor-notices__snackbar",
      onRemove: removeNotice
    }
  );
}
export {
  EditorSnackbars as default
};
//# sourceMappingURL=index.js.map
