import { jsx as _jsx } from "react/jsx-runtime";
import { Text } from 'ink';
import Gradient from 'ink-gradient';
import { theme } from '../semantic-colors.js';
/**
 * ThemedGradient component that safely handles gradient rendering
 * in terminals without full truecolor support (e.g., tmux without proper settings).
 *
 * Behavior:
 * - If gradient has 2+ colors: render with Gradient
 * - If gradient has 1 color: render with single color
 * - If gradient is undefined/empty: render plain text with default color
 */
export const ThemedGradient = ({ children, colors, }) => {
    const gradient = colors ?? theme.ui.gradient;
    if (gradient && gradient.length >= 2) {
        return (_jsx(Gradient, { colors: gradient, children: _jsx(Text, { color: theme.text.primary, children: children }) }));
    }
    if (gradient && gradient.length === 1) {
        return _jsx(Text, { color: gradient[0], children: children });
    }
    // Fallback to accent color if no gradient
    return _jsx(Text, { color: theme.text.accent, children: children });
};
//# sourceMappingURL=ThemedGradient.js.map