'use client';
import { jsx as _jsx } from "react/jsx-runtime";
import { DebugContextCard } from './debug-context-card';
import { ResponseOptionsCard } from './response-options-card';
import { EndpointContextCard } from './endpoint-context-card';
import { decodeCardMessage } from './types';
// Export types and utilities
export * from './types';
export { DebugContextCard } from './debug-context-card';
export { ResponseOptionsCard, detectErrorType } from './response-options-card';
export { EndpointContextCard } from './endpoint-context-card';
/**
 * Renders a card based on the encoded message content.
 * Returns null if the content is not a valid card message.
 */ export function CardRenderer({ content, actions }) {
    const cardData = decodeCardMessage(content);
    if (!cardData) {
        return null;
    }
    return /*#__PURE__*/ _jsx(CardByType, {
        data: cardData,
        actions: actions
    });
}
/**
 * Renders the appropriate card component based on the card type.
 */ function CardByType({ data, actions }) {
    switch(data.type){
        case 'debug_context':
            return /*#__PURE__*/ _jsx(DebugContextCard, {
                context: data.context
            });
        case 'response_options':
            return /*#__PURE__*/ _jsx(ResponseOptionsCard, {
                errorType: data.errorType,
                actions: actions
            });
        case 'endpoint_context':
            return /*#__PURE__*/ _jsx(EndpointContextCard, {
                endpoint: data.endpoint
            });
        default:
            return null;
    }
}
