From c4c55a93bc6af8b15f45225169758e08ff1b13cd Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Mon, 17 Jul 2023 20:42:50 -0400 Subject: Initial rewrite --- components/PSA.js | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 components/PSA.js (limited to 'components/PSA.js') diff --git a/components/PSA.js b/components/PSA.js new file mode 100644 index 0000000..8dad8b3 --- /dev/null +++ b/components/PSA.js @@ -0,0 +1,42 @@ +import psaMessage from './psa.json' assert { type: 'json' }; +import Link from "next/link"; + +const PSA = () => { + let defaultStyle = "flex flex-row md:px-40 px-30 py-0.5 space-x-2"; + let styleImportant; + let important; + switch (psaMessage.important) { + case 0: + styleImportant = "hidden" + defaultStyle += ' ' + styleImportant + break; + case 1: + important = "WARNING!" + styleImportant = "bg-yellow-700" + defaultStyle += ' ' + styleImportant + break; + case 2: + important = "EMERGENCY!" + styleImportant = "bg-red-800" + defaultStyle += ' ' + styleImportant + break; + + } + + return ( +
+

{important}

+
+

{psaMessage.announcement}

+

+ {psaMessage.link && ( + + Learn more ↗ + + )}

+
+
+ ) +} + +export default PSA; -- cgit v1.2.3