( statusDot: HTMLElement, statusConfig: StatusConfig | null | undefined )
| 85 | } |
| 86 | |
| 87 | export function configureStatusIndicator( |
| 88 | statusDot: HTMLElement, |
| 89 | statusConfig: StatusConfig | null | undefined |
| 90 | ): void { |
| 91 | if (statusConfig?.color) { |
| 92 | statusDot.style.borderColor = statusConfig.color; |
| 93 | } else { |
| 94 | statusDot.style.removeProperty("border-color"); |
| 95 | } |
| 96 | |
| 97 | if (statusConfig?.icon) { |
| 98 | statusDot.addClass("task-card__status-dot--icon"); |
| 99 | statusDot.empty(); |
| 100 | setIcon(statusDot, statusConfig.icon); |
| 101 | } else { |
| 102 | statusDot.removeClass("task-card__status-dot--icon"); |
| 103 | statusDot.empty(); |
| 104 | statusDot.removeAttribute("data-icon"); |
| 105 | statusDot.classList.remove("has-icon"); |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | export function createStatusIndicator(config: StatusIndicatorConfig): HTMLElement | null { |
| 110 | const { |
no test coverage detected