blob: da5f35be042f371c3f9490d5c4e7fdb6f95bf899 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
import psaMessage from './psa.json' with { type: 'json' };
import Link from "next/link";
const PSA = () => {
let defaultStyle = "flex flex-row md:px-40 sm:px-30 sm:py-0.5 p-3 space-x-2";
let styleImportant;
let important;
switch (psaMessage.important) {
case 0:
styleImportant = "hidden"
defaultStyle += ' ' + styleImportant
break;
case 1:
important = "Latest News:"
styleImportant = "bg-zinc-700"
defaultStyle += ' ' + styleImportant
break;
case 2:
important = "WARNING!"
styleImportant = "bg-yellow-700"
defaultStyle += ' ' + styleImportant
break;
case 3:
important = "EMERGENCY!"
styleImportant = "bg-red-800"
defaultStyle += ' ' + styleImportant
break;
}
return (
<div className={defaultStyle}>
<p className="text-lg font-medium sm:p-0">{important}</p>
<div className="flex sm:flex-row flex-col sm:space-x-3">
<p>{psaMessage.announcement}</p>
<p className="text-blue-200 hover:text-blue-500 active:text-blue-700">
{psaMessage.link && (
<Link href={psaMessage.link}>
Learn more
</Link>
)}</p>
</div>
</div>
)
}
export default PSA;
|