Skip to content

Commit

Permalink
feat(ui): add status remapping to status component to match the real …
Browse files Browse the repository at this point in the history
…name of the CSS vars
  • Loading branch information
elevatebart committed Jan 8, 2025
1 parent 1476064 commit a8be084
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions ui/src/components/Status.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
<script>
import State from "../utils/state";
const StatusRemap = {
"failed": "error",
"warn": "warning"
}
export default {
props: {
status: {
Expand All @@ -32,10 +37,11 @@
emits: ["click"],
computed: {
style() {
const statusVarname = (StatusRemap[this.status.toLowerCase()] ?? this.status)?.toLowerCase()
return {
color: `var(--ks-content-${this.status?.toLowerCase()}) !important`,
"border-color": `var(--ks-border-${this.status?.toLowerCase()}) !important`,
"background-color": `var(--ks-background-${this.status?.toLowerCase()}) !important`
color: `var(--ks-content-${statusVarname}) !important`,
"border-color": `var(--ks-border-${statusVarname}) !important`,
"background-color": `var(--ks-background-${statusVarname}) !important`
};
},
icon() {
Expand Down

0 comments on commit a8be084

Please sign in to comment.