From 9372f7da2f86e43a8fc35b5042610782795d79f6 Mon Sep 17 00:00:00 2001
From: ivarlovlie <git@ivarlovlie.no>
Date: Tue, 11 Oct 2022 12:55:31 +0800
Subject: feat: Add badges

---
 .../src/lib/components/project-status-badge.svelte | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 code/app/src/lib/components/project-status-badge.svelte

(limited to 'code/app/src/lib/components/project-status-badge.svelte')

diff --git a/code/app/src/lib/components/project-status-badge.svelte b/code/app/src/lib/components/project-status-badge.svelte
new file mode 100644
index 0000000..5390344
--- /dev/null
+++ b/code/app/src/lib/components/project-status-badge.svelte
@@ -0,0 +1,24 @@
+<script lang="ts">
+    import type { ProjectStatus } from "$lib/models/projects/ProjectStatus";
+    import Badge from "./badge.svelte";
+    export let status: string | ProjectStatus;
+
+    let text = "";
+    let type = "default" as any;
+    $: switch (status) {
+        case "idl":
+            type = "tame";
+            text = "IDLE";
+            break;
+        case "exp":
+            type = "yellow";
+            text = "EXPIRED";
+            break;
+        case "act":
+            type = "green";
+            text = "ACTIVE";
+            break;
+    }
+</script>
+
+<Badge {text} {type} uppercase />
-- 
cgit v1.3

