"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createThemedIcon = createThemedIcon;
exports.Icon = Icon;
const jsx_runtime_1 = require("react/jsx-runtime");
const theme_1 = require("../../lib/theme/theme");
// Size mapping
const sizeMap = {
    sm: 16,
    md: 20,
    lg: 24,
    xl: 32,
};
// HOC to create themed icons
function createThemedIcon(IconComponent) {
    return ({ variant = "default", size = "md", color, ...restProps }) => {
        let theme = (0, theme_1.useTheme)(); // Ensure theme is available
        // Calculate size
        const iconSize = typeof size === "number" ? size : sizeMap[size];
        // Calculate color if not provided using atoms
        const iconColor = color ||
            theme.theme.colors[variant] ||
            theme.theme.colors.secondaryForeground;
        return ((0, jsx_runtime_1.jsx)(IconComponent, { size: iconSize, color: iconColor, ...restProps }));
    };
}
// usage of createThemedIcon
function Icon({ icon, variant = "default", size = "md", color, ...restProps }) {
    const ThemedIcon = createThemedIcon(icon);
    return ((0, jsx_runtime_1.jsx)(ThemedIcon, { variant: variant, size: size, color: color, ...restProps }));
}
//# sourceMappingURL=icons.js.map