aboutsummaryrefslogtreecommitdiff
path: root/src/components/PSA.astro
blob: ad2bcdf3690736f9260e9f0e6d057e6923115724 (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
---
import psaMessage from "./psa.json";
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;
}
---

<div class={defaultStyle}>
    <p class="text-lg font-medium sm:p-0">{important}</p>
    <div class="flex sm:flex-row flex-col sm:space-x-3">
        <p>{psaMessage.announcement}</p>
        <p class="text-blue-200 hover:text-blue-500 active:text-blue-700">
            {psaMessage.link && (
                    <a href={psaMessage.link}>
                        Learn more ↗
                    </a>
            )}</p>
    </div>
</div>