shelving
Version:
Toolkit for using data in JavaScript.
14 lines (13 loc) • 782 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { PARAGRAPH_CLASS } from "../block/Paragraph.js";
import { LOADING } from "../misc/Loading.js";
import { getColorClass } from "../style/Color.js";
import { getStatusClass } from "../style/Status.js";
import { getClass } from "../util/css.js";
import MESSAGE_CSS from "./Message.module.css";
/** Paragraph with status colours. */
export function Message({ children, status = "info", ...variants }) {
return (_jsx("p", { role: status === "error" || status === "danger" ? "alert" : "status", className: getClass(PARAGRAPH_CLASS, //
MESSAGE_CSS.message, getStatusClass(status), getColorClass(variants)), children: children }));
}
export const LOADING_MESSAGE = _jsx(Message, { status: "loading", children: LOADING });