import { cn } from '@/lib/utils'; import { useAppStore } from '@/store/app-store'; import type { ModelAlias, CursorModelId } from '@automaker/types'; import { stripProviderPrefix } from '@automaker/types'; import { CLAUDE_MODELS, CURSOR_MODELS } from '@/components/views/board-view/shared/model-constants'; interface PhaseModelSelectorProps { label: string; description: string; value: ModelAlias | CursorModelId; onChange: (model: ModelAlias | CursorModelId) => void; } export function PhaseModelSelector({ label, description, value, onChange, }: PhaseModelSelectorProps) { const { enabledCursorModels } = useAppStore(); // Filter Cursor models to only show enabled ones const availableCursorModels = CURSOR_MODELS.filter((model) => { const cursorId = stripProviderPrefix(model.id) as CursorModelId; return enabledCursorModels.includes(cursorId); }); return (
{/* Label and Description */}

{label}

{description}

{/* Model Selection */}
{/* Claude Models */} {CLAUDE_MODELS.map((model) => { const isActive = value === model.id; return ( ); })} {/* Divider if there are Cursor models */} {availableCursorModels.length > 0 && (
)} {/* Cursor Models */} {availableCursorModels.map((model) => { const cursorId = stripProviderPrefix(model.id) as CursorModelId; const isActive = value === cursorId; return ( ); })}
); }