shelving
Version:
Toolkit for using data in JavaScript.
12 lines (11 loc) • 471 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { useStore } from "../../react/useStore.js";
import { Notice } from "../notice/Notice.js";
import { requireForm } from "./FormContext.js";
/** Show the "main" message for the form as a `<Notice>` */
export function FormNotice(props) {
const message = useStore(requireForm().messages).get("");
if (!message)
return null;
return (_jsx(Notice, { status: "error", ...props, children: message }));
}