MCPcopy
hub / github.com/callumalpass/tasknotes / configureStatusIndicator

Function configureStatusIndicator

src/ui/taskCardPrimaryIndicators.ts:87–107  ·  view source on GitHub ↗
(
	statusDot: HTMLElement,
	statusConfig: StatusConfig | null | undefined
)

Source from the content-addressed store, hash-verified

85}
86
87export 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
109export function createStatusIndicator(config: StatusIndicatorConfig): HTMLElement | null {
110 const {

Callers 3

createStatusIndicatorFunction · 0.85
updateStatusIndicatorFunction · 0.85

Calls 2

setIconFunction · 0.90
addClassMethod · 0.65

Tested by

no test coverage detected