import { jsx as _jsx } from "react/jsx-runtime";
import { ModelDatabaseDisplay } from '../../commands/model-database.js';
import CheckpointSelector from '../../components/checkpoint-selector.js';
import ModelSelector from '../../components/model-selector.js';
import SessionSelector from '../../components/session-selector.js';
import { McpWizard } from '../../wizards/mcp-wizard.js';
import { ProviderWizard } from '../../wizards/provider-wizard.js';
import { SettingsSelector } from './settings-selector.js';
import { TuneSelector } from './tune-selector.js';
/**
 * Renders the appropriate modal selector based on current application mode
 * Returns null if no modal is active
 */
export function ModalSelectors({ activeMode, isSettingsMode, showAllSessions, currentModel, currentProvider, checkpointLoadData, onModelSelect, onModelSelectionCancel, onModelDatabaseCancel, onConfigWizardComplete, onConfigWizardCancel, onMcpWizardComplete, onMcpWizardCancel, onCheckpointSelect, onCheckpointCancel, onSessionSelect, onSessionCancel, onSettingsCancel, tuneConfig, onTuneSelect, onTuneCancel, }) {
    if (activeMode === 'model') {
        return (_jsx(ModelSelector, { currentProvider: currentProvider, currentModel: currentModel, onModelSelect: (provider, model) => void onModelSelect(provider, model), onCancel: onModelSelectionCancel }));
    }
    if (activeMode === 'tune') {
        return (_jsx(TuneSelector, { currentConfig: tuneConfig, onSelect: config => void onTuneSelect(config), onCancel: onTuneCancel }));
    }
    if (isSettingsMode) {
        return _jsx(SettingsSelector, { onCancel: onSettingsCancel });
    }
    if (activeMode === 'modelDatabase') {
        return _jsx(ModelDatabaseDisplay, { onCancel: onModelDatabaseCancel });
    }
    if (activeMode === 'configWizard') {
        return (_jsx(ProviderWizard, { projectDir: process.cwd(), onComplete: configPath => void onConfigWizardComplete(configPath), onCancel: onConfigWizardCancel }));
    }
    if (activeMode === 'mcpWizard') {
        return (_jsx(McpWizard, { projectDir: process.cwd(), onComplete: configPath => void onMcpWizardComplete(configPath), onCancel: onMcpWizardCancel }));
    }
    if (activeMode === 'checkpointLoad' && checkpointLoadData) {
        return (_jsx(CheckpointSelector, { checkpoints: checkpointLoadData.checkpoints, currentMessageCount: checkpointLoadData.currentMessageCount, onSelect: (name, backup) => void onCheckpointSelect(name, backup), onCancel: onCheckpointCancel }));
    }
    if (activeMode === 'sessionSelector') {
        return (_jsx(SessionSelector, { onSelect: meta => meta ? void onSessionSelect(meta.id) : onSessionCancel(), onCancel: onSessionCancel, showAll: showAllSessions }));
    }
    return null;
}
//# sourceMappingURL=modal-selectors.js.map