@wordpress/components
Version:
UI components for WordPress.
35 lines (34 loc) • 849 B
JavaScript
import clsx from "clsx";
import Notice from ".";
import { createElement as _createElement } from "react";
import { jsxs as _jsxs } from "react/jsx-runtime";
const noop = () => {
};
function NoticeList({
notices,
onRemove = noop,
className,
children
}) {
const removeNotice = (id) => () => onRemove(id);
className = clsx("components-notice-list", className);
return /* @__PURE__ */ _jsxs("div", {
className,
children: [children, [...notices].reverse().map((notice) => {
const {
content,
...restNotice
} = notice;
return /* @__PURE__ */ _createElement(Notice, {
...restNotice,
key: notice.id,
onRemove: removeNotice(notice.id)
}, notice.content);
})]
});
}
var list_default = NoticeList;
export {
list_default as default
};
//# sourceMappingURL=list.js.map