import { useEffect, useState } from 'react'; import { deleteOpenAIKey, getOpenAIKey, saveOpenAIKey } from '../../lib/jwt.ts'; import { cn } from '../../lib/classname.ts'; import { CloseIcon } from '../ReactIcons/CloseIcon.tsx'; import { useToast } from '../../hooks/use-toast.ts'; import { httpPost } from '../../lib/http.ts'; import { ChevronLeft } from 'lucide-react'; type OpenAISettingsProps = { onClose: () => void; onBack: () => void; }; export function OpenAISettings(props: OpenAISettingsProps) { const { onClose, onBack } = props; const [defaultOpenAIKey, setDefaultOpenAIKey] = useState(''); const [error, setError] = useState(''); const [openaiApiKey, setOpenaiApiKey] = useState(''); const [isLoading, setIsLoading] = useState(false); const toast = useToast(); useEffect(() => { const apiKey = getOpenAIKey(); setOpenaiApiKey(apiKey || ''); setDefaultOpenAIKey(apiKey || ''); }, []); return (
Add your OpenAI API key below to bypass the roadmap generation limits. You can use your existing key or{' '} create a new one here .