import { Text } from 'ink';
import React from 'react';
import NanocoderShapeSelector from '../components/nanocoder-shape-selector.js';
import { colors } from '../config/index.js';
import { updateNanocoderShape } from '../config/preferences.js';
const validShapes = [
    'block',
    'slick',
    'tiny',
    'grid',
    'pallet',
    'shade',
    'simple',
    'simpleBlock',
    '3d',
    'simple3d',
    'chrome',
    'huge',
];
export const nanocoderShapeCommand = {
    name: 'nanocoder-shape',
    description: 'Select a branding style for the Nanocoder welcome banner',
    handler: async (args, _messages, _metadata) => {
        if (args.length === 0) {
            // Show interactive selector when no arguments provided
            return Promise.resolve(React.createElement(NanocoderShapeSelector, {
                onComplete: (shape) => {
                    return React.createElement(Text, { color: colors.success }, `Nanocoder shape set to: ${shape}`);
                },
                onCancel: () => {
                    return React.createElement(Text, { color: colors.info }, 'Nanocoder shape selection cancelled. Current style retained.');
                },
            }));
        }
        // If a shape is provided as argument, set it directly
        const shape = args[0];
        if (validShapes.includes(shape)) {
            updateNanocoderShape(shape);
            return Promise.resolve(React.createElement(Text, { color: colors.success }, `Nanocoder shape set to: ${shape}`));
        }
        else {
            return Promise.resolve(React.createElement(Text, { color: colors.error }, `Invalid shape: ${shape}. Available shapes: ${validShapes.join(', ')}`));
        }
    },
};
//# sourceMappingURL=nanocoder-shape.js.map