diff --git a/frontend/src/components/ApiKeyDialog.tsx b/frontend/src/components/ApiKeyDialog.tsx new file mode 100644 index 00000000..64840288 --- /dev/null +++ b/frontend/src/components/ApiKeyDialog.tsx @@ -0,0 +1,112 @@ +interface ApiKeyDialogProps { + apiKeyInput: string; + onApiKeyChange: (value: string) => void; + onSave: () => void; + onCancel: () => void; +} + +export function ApiKeyDialog({ + apiKeyInput, + onApiKeyChange, + onSave, + onCancel, +}: ApiKeyDialogProps) { + return ( +
+ To use Claude models, please enter your Anthropic API key. Your key + will be stored server-side and reused across sessions. +
+ onApiKeyChange(e.target.value)} + onKeyDown={(e) => e.key === "Enter" && onSave()} + placeholder="sk-ant-..." + style={{ + width: "100%", + padding: "12px", + borderRadius: "8px", + border: "1px solid #555", + backgroundColor: "#1a1a1a", + color: "#ececec", + fontSize: "1em", + marginBottom: "20px", + outline: "none", + }} + /> +
- {children}
-
- );
- },
- }}
- >
- {content}
-