synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
18 lines (17 loc) • 690 B
JavaScript
import { jsx as a, Fragment as l } from "react/jsx-runtime";
import d from "../FullWidthAlert/FullWidthAlert.js";
const f = ({
deadline: r,
content: t,
...i
}) => {
const e = r.trim(), n = /^\d{4}-\d{2}-\d{2}$/.test(e) ? (
// Append a local end-of-day timestamp so "YYYY-MM-DD" deadlines last through 11:59 PM.
/* @__PURE__ */ new Date(`${e}T23:59:59.999`)
) : new Date(e), o = /* @__PURE__ */ new Date();
return isNaN(n.getTime()) ? (console.error("TemporaryBanner: Invalid deadline date:", r), null) : o <= n ? t ? /* @__PURE__ */ a(l, { children: t }) : /* @__PURE__ */ a(d, { ...i }) : null;
};
export {
f as default
};
//# sourceMappingURL=TemporaryBanner.js.map