"use client" import { useState } from "react" import { Button } from "@repo/ui/components/button" import { ChevronDown } from "lucide-react" import { motion } from "motion/react" const models = [ { id: "gpt-5", name: "GPT 5", description: "OpenAI's latest model", }, { id: "claude-sonnet-4.5", name: "Claude Sonnet 4.5", description: "Anthropic's advanced model", }, { id: "gemini-2.5-pro", name: "Gemini 2.5 Pro", description: "Google's most capable model", }, ] as const type ModelId = (typeof models)[number]["id"] interface ModelSelectorProps { selectedModel?: ModelId onModelChange?: (modelId: ModelId) => void disabled?: boolean } export function ModelSelector({ selectedModel = "gemini-2.5-pro", onModelChange, disabled = false, }: ModelSelectorProps) { const [isOpen, setIsOpen] = useState(false) const currentModel = models.find((m) => m.id === selectedModel) || models[0] const handleModelSelect = (modelId: ModelId) => { onModelChange?.(modelId) setIsOpen(false) } return (
{isOpen && ( <> ))}
)} ) }