fix: prepare add UI input for openai key
This commit is contained in:
parent
9dd13716be
commit
48195371e2
@ -9,6 +9,7 @@ import {
|
|||||||
SelectItem,
|
SelectItem,
|
||||||
SelectTrigger,
|
SelectTrigger,
|
||||||
SelectValue,
|
SelectValue,
|
||||||
|
Input,
|
||||||
} from '@janhq/uikit'
|
} from '@janhq/uikit'
|
||||||
|
|
||||||
import { atom, useAtomValue, useSetAtom } from 'jotai'
|
import { atom, useAtomValue, useSetAtom } from 'jotai'
|
||||||
@ -36,7 +37,6 @@ export default function DropdownListSidebar() {
|
|||||||
const activeThread = useAtomValue(activeThreadAtom)
|
const activeThread = useAtomValue(activeThreadAtom)
|
||||||
const [selected, setSelected] = useState<Model | undefined>()
|
const [selected, setSelected] = useState<Model | undefined>()
|
||||||
const { setMainViewState } = useMainViewState()
|
const { setMainViewState } = useMainViewState()
|
||||||
|
|
||||||
const { activeModel, stateModel } = useActiveModel()
|
const { activeModel, stateModel } = useActiveModel()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -77,6 +77,7 @@ export default function DropdownListSidebar() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<>
|
||||||
<Select
|
<Select
|
||||||
disabled={finishInit}
|
disabled={finishInit}
|
||||||
value={selected?.id}
|
value={selected?.id}
|
||||||
@ -127,5 +128,25 @@ export default function DropdownListSidebar() {
|
|||||||
</div>
|
</div>
|
||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
|
|
||||||
|
{selected?.engine === 'openai' && (
|
||||||
|
<div className="mt-4">
|
||||||
|
<label
|
||||||
|
id="thread-title"
|
||||||
|
className="mb-2 inline-block font-bold text-gray-600 dark:text-gray-300"
|
||||||
|
>
|
||||||
|
API_KEY
|
||||||
|
</label>
|
||||||
|
<Input
|
||||||
|
id="assistant-instructions"
|
||||||
|
placeholder="Enter your API_KEY"
|
||||||
|
value=""
|
||||||
|
onChange={(e) => {
|
||||||
|
console.log(e.target.value)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user