import { AlertTriangle } from "lucide-react" import { useDashboard } from "@/lib/dashboard" import { Label } from "@/components/ui/label" import { Input } from "@/components/ui/input" import { Button } from "@/components/ui/button" import { Switch } from "@/components/ui/switch" import { Separator } from "@/components/ui/separator" import { cn } from "@/lib/utils" import type { CompilerProvider } from "@/lib/types" const PROVIDERS: { id: CompilerProvider; label: string; placeholder: string }[] = [ { id: "replicate", label: "Replicate", placeholder: "r8_..." }, { id: "openai", label: "OpenAI", placeholder: "sk-..." }, { id: "anthropic", label: "Claude", placeholder: "sk-ant-..." }, ] const MODELS = { openai: [ { value: "gpt-5.5", label: "GPT-5.5" }, { value: "gpt-5.4", label: "GPT-5.4" }, { value: "gpt-5.4-mini", label: "GPT-5.4 mini" }, ], anthropic: [ { value: "claude-sonnet-4-6", label: "Claude Sonnet 4.6" }, { value: "claude-opus-4-8", label: "Claude Opus 4.8" }, { value: "claude-haiku-4-5-20251001", label: "Claude Haiku 4.5" }, ], } export function SettingsPanel() { const { params, setParam, compiler, setCompilerProvider, setCompilerApiKey, setCompilerModel, } = useDashboard() const activeProvider = PROVIDERS.find((provider) => provider.id === compiler.provider) ?? PROVIDERS[0] const apiKey = compiler.provider === "replicate" ? compiler.replicateApiKey : compiler.provider === "openai" ? compiler.openaiApiKey : compiler.anthropicApiKey const model = compiler.provider === "openai" ? compiler.openaiModel : compiler.provider === "anthropic" ? compiler.anthropicModel : "" const modelProvider = compiler.provider === "openai" || compiler.provider === "anthropic" ? compiler.provider : null return (
Off by default — actions only simulate.
Keys pasted here are sent only when compiling. Space owners can also set provider secrets as environment variables.