diff options
| author | ivarlovlie <git@ivarlovlie.no> | 2022-10-11 06:55:31 +0200 |
|---|---|---|
| committer | ivarlovlie <git@ivarlovlie.no> | 2022-10-11 06:55:31 +0200 |
| commit | 9372f7da2f86e43a8fc35b5042610782795d79f6 (patch) | |
| tree | 633494bbf62be0b75c14557a57c55b74aafae862 /code/app/src/lib/components/project-status-badge.svelte | |
| parent | c2c69ce73461ce6335bb0be67bdec52e95f3aafe (diff) | |
| download | greatoffice-9372f7da2f86e43a8fc35b5042610782795d79f6.tar.xz greatoffice-9372f7da2f86e43a8fc35b5042610782795d79f6.zip | |
feat: Add badges
Diffstat (limited to 'code/app/src/lib/components/project-status-badge.svelte')
| -rw-r--r-- | code/app/src/lib/components/project-status-badge.svelte | 24 |
1 files changed, 24 insertions, 0 deletions
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 /> |
