/**
 * @license MIT
 * author: Cube Dev Team
 * @cube-dev/ui-kit v0.0.0-canary-c015414
 * Released under the MIT license.
 */

/**
 * Resolves a dynamic icon prop to its content and slot state.
 * - If `true`: empty slot (hasSlot=true, content=null)
 * - If function: call with mods, then process result
 * - Otherwise: use as-is
 */
export function resolveIcon(icon, mods) {
    if (icon === undefined || icon === null || icon === false) {
        return { content: null, hasSlot: false };
    }
    if (icon === true) {
        return { content: null, hasSlot: true };
    }
    if (typeof icon === 'function') {
        const result = icon(mods);
        if (result === true) {
            return { content: null, hasSlot: true };
        }
        if (result === undefined || result === null || result === false) {
            return { content: null, hasSlot: false };
        }
        return { content: result, hasSlot: true };
    }
    return { content: icon, hasSlot: true };
}

        