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