|
|
|
@ -15,14 +15,14 @@ export type IconBadgeReducerAction = { |
|
|
|
|
function setIconStatus(name: string, status: IconStatus) { |
|
|
|
|
if (status.key === 'none') return { ...status, text: '' } // remove status
|
|
|
|
|
|
|
|
|
|
let text = '' |
|
|
|
|
let key = '' |
|
|
|
|
let text: string | number |
|
|
|
|
let key: string | number |
|
|
|
|
if (typeof status.key === 'number') { |
|
|
|
|
key = status.key |
|
|
|
|
text = key |
|
|
|
|
} else key = checkSpecialChars(status.key) ? bleach.sanitize(status.key) : status.key |
|
|
|
|
|
|
|
|
|
let thisType = '' |
|
|
|
|
let thisType: IconStatus['type'] |
|
|
|
|
if (status.type === 'error') { |
|
|
|
|
thisType = 'danger' // to use with bootstrap
|
|
|
|
|
} else thisType = checkSpecialChars(status.type) ? bleach.sanitize(status.type) : status.type |
|
|
|
|