export function textValue(value, fallback = '') {
    return value == null || value === '' ? fallback : String(value);
}

export function createTextElement(tagName, className, value, fallback = '') {
    const element = document.createElement(tagName);
    if (className) {
        element.className = className;
    }
    element.textContent = textValue(value, fallback);
    return element;
}

export function createIconElement(className) {
    const icon = document.createElement('i');
    icon.className = className;
    return icon;
}
