diff --git a/bun.lockb b/bun.lockb index 34b7e7e..05f3e8f 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/src/app/settings/page.tsx b/src/app/settings/page.tsx index d9a99a2..ef2de71 100644 --- a/src/app/settings/page.tsx +++ b/src/app/settings/page.tsx @@ -16,6 +16,11 @@ export type SpecializedField = placeholder: string defaultValue: string } + | { + type: 'password' + placeholder: string + defaultValue: string + } | { type: 'boolean' defaultValue: boolean @@ -96,7 +101,7 @@ const fields: Partial & MiscPanelFields = { label: 'API Key', description: '', placeholder: 'Enter your OpenAI API access key', - type: 'text', + type: 'password', defaultValue: '', }, openAIModel: { @@ -188,9 +193,10 @@ function Favorites() {
{label}
)}
- {field.type === 'text' ? ( + {field.type === 'text' || field.type === 'password' ? ( { console.log('changed!') setSettings((settings) => ({ diff --git a/src/components/inputs/SettingInput.tsx b/src/components/inputs/SettingInput.tsx index 4a9216a..58536e5 100644 --- a/src/components/inputs/SettingInput.tsx +++ b/src/components/inputs/SettingInput.tsx @@ -1,17 +1,20 @@ export const SettingInput = ({ onChange, onSubmit, + type = "text", placeholder, value, }: { onChange?: (value: string) => void onSubmit?: (value: string) => void + type: "text" | "password" placeholder?: string value?: string }) => ( onChange?.(e.currentTarget.value)} + type={type} onKeyDown={(e) => { if (e.key === 'Enter') { onSubmit?.(e.currentTarget.value)