Skip to content

Commit

Permalink
add div
Browse files Browse the repository at this point in the history
  • Loading branch information
aakrem committed Nov 27, 2023
1 parent 849e0d3 commit ae36b0b
Showing 1 changed file with 37 additions and 35 deletions.
72 changes: 37 additions & 35 deletions agenta-web/src/components/pages/settings/Secrets/Secrets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,43 +52,45 @@ export default function Secrets() {

<div className={classes.apiContainer}>
{llmProviderKeys.map(({title, key}: LlmProvider, i: number) => (
<Space direction="horizontal" key={i}>
<Input.Password
data-cy="openai-api-input"
value={key}
onChange={(e) => {
const newLlmProviderKeys = [...llmProviderKeys]
newLlmProviderKeys[i].key = e.target.value
setLlmProviderKeys(newLlmProviderKeys)
}}
addonBefore={`${title}`}
visibilityToggle={false}
className={classes.input}
/>
<Button
data-cy="openai-api-save"
disabled={key === getLlmProviderKey(key) || !key}
onClick={() => {
saveLlmProviderKey(i, key)
messageAPI.success("The secret is saved")
}}
>
Save
</Button>
<Button
onClick={() => {
removeSingleLlmProviderKey(i)
<div>
<Space direction="horizontal" key={i}>
<Input.Password
data-cy="openai-api-input"
value={key}
onChange={(e) => {
const newLlmProviderKeys = [...llmProviderKeys]
newLlmProviderKeys[i].key = e.target.value
setLlmProviderKeys(newLlmProviderKeys)
}}
addonBefore={`${title}`}
visibilityToggle={false}
className={classes.input}
/>
<Button
data-cy="openai-api-save"
disabled={key === getLlmProviderKey(key) || !key}
onClick={() => {
saveLlmProviderKey(i, key)
messageAPI.success("The secret is saved")
}}
>
Save
</Button>
<Button
onClick={() => {
removeSingleLlmProviderKey(i)

const newLlmProviderKeys = [...llmProviderKeys]
newLlmProviderKeys[i].key = ""
setLlmProviderKeys(newLlmProviderKeys)
const newLlmProviderKeys = [...llmProviderKeys]
newLlmProviderKeys[i].key = ""
setLlmProviderKeys(newLlmProviderKeys)

messageAPI.warning("The secret is deleted")
}}
>
Delete
</Button>
</Space>
messageAPI.warning("The secret is deleted")
}}
>
Delete
</Button>
</Space>
</div>
))}
</div>
</div>
Expand Down

0 comments on commit ae36b0b

Please sign in to comment.