UNPKG

1.52 kBJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.Footer = void 0;
7
8var _preact = require("preact");
9
10var _milliseconds = _interopRequireDefault(require("milliseconds"));
11
12function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
14const currentYear = new Date().getFullYear();
15
16const getUpdatedText = updatedDate => {
17 if (Date.now() - updatedDate < _milliseconds.default.weeks(2)) {
18 const date = new Date(updatedDate);
19 return "".concat(date.getMonth() + 1, "/").concat(date.getDate(), "/").concat((date.getFullYear() + '').slice(2));
20 }
21};
22
23const linkClasses = 'link f6 gray no-underline underline-hover';
24
25const Footer = ({
26 privacyUrl = 'https://legal.anesthesiacharting.com/privacy',
27 termsUrl = 'https://legal.anesthesiacharting.com/terms',
28 version,
29 privacyUpdatedDate,
30 hideLinks,
31 extra
32}) => {
33 const updateText = privacyUpdatedDate && getUpdatedText(privacyUpdatedDate);
34 return (0, _preact.h)("footer", {
35 className: "pt2 pb3 tc f6 gray mb7"
36 }, "\xA9 ", currentYear, " I.V. Enterprises LLC ", version && "v".concat(version), ' ', !hideLinks && (0, _preact.h)("div", {
37 className: "mt1 no-print"
38 }, (0, _preact.h)("a", {
39 className: linkClasses,
40 href: termsUrl,
41 rel: "noopener"
42 }, "terms"), ' | ', (0, _preact.h)("a", {
43 className: linkClasses,
44 href: privacyUrl,
45 rel: "noopener"
46 }, "privacy"), updateText && " (updated ".concat(updateText, ")")), extra);
47};
48
49exports.Footer = Footer;
\No newline at end of file