// packages/editor/src/components/editor-notices/index.js
import { NoticeList } from "@wordpress/components";
import { useDispatch, useSelect } from "@wordpress/data";
import { store as noticesStore } from "@wordpress/notices";
import TemplateValidationNotice from "../template-validation-notice/index.js";
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
function EditorNotices() {
  const { notices } = useSelect(
    (select) => ({
      notices: select(noticesStore).getNotices()
    }),
    []
  );
  const { removeNotice } = useDispatch(noticesStore);
  const dismissibleNotices = notices.filter(
    ({ isDismissible, type }) => isDismissible && type === "default"
  );
  const nonDismissibleNotices = notices.filter(
    ({ isDismissible, type }) => !isDismissible && type === "default"
  );
  return /* @__PURE__ */ jsxs(Fragment, { children: [
    /* @__PURE__ */ jsx(
      NoticeList,
      {
        notices: nonDismissibleNotices,
        className: "components-editor-notices__pinned"
      }
    ),
    /* @__PURE__ */ jsx(
      NoticeList,
      {
        notices: dismissibleNotices,
        className: "components-editor-notices__dismissible",
        onRemove: removeNotice,
        children: /* @__PURE__ */ jsx(TemplateValidationNotice, {})
      }
    )
  ] });
}
var editor_notices_default = EditorNotices;
export {
  EditorNotices,
  editor_notices_default as default
};
//# sourceMappingURL=index.js.map
