|
|
@ -89,10 +89,11 @@ type GetAIRoadmapResponse = { |
|
|
|
|
|
|
|
|
|
|
|
type GenerateRoadmapProps = { |
|
|
|
type GenerateRoadmapProps = { |
|
|
|
roadmapId?: string; |
|
|
|
roadmapId?: string; |
|
|
|
|
|
|
|
t?: string; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
export function GenerateRoadmap(props: GenerateRoadmapProps) { |
|
|
|
export function GenerateRoadmap(props: GenerateRoadmapProps) { |
|
|
|
const { roadmapId } = props; |
|
|
|
const { roadmapId, t: term = '' } = props; |
|
|
|
|
|
|
|
|
|
|
|
const roadmapContainerRef = useRef<HTMLDivElement>(null); |
|
|
|
const roadmapContainerRef = useRef<HTMLDivElement>(null); |
|
|
|
|
|
|
|
|
|
|
@ -104,7 +105,7 @@ export function GenerateRoadmap(props: GenerateRoadmapProps) { |
|
|
|
const [hasSubmitted, setHasSubmitted] = useState<boolean>(Boolean(roadmapId)); |
|
|
|
const [hasSubmitted, setHasSubmitted] = useState<boolean>(Boolean(roadmapId)); |
|
|
|
const [isLoading, setIsLoading] = useState(false); |
|
|
|
const [isLoading, setIsLoading] = useState(false); |
|
|
|
const [isLoadingResults, setIsLoadingResults] = useState(false); |
|
|
|
const [isLoadingResults, setIsLoadingResults] = useState(false); |
|
|
|
const [roadmapTerm, setRoadmapTerm] = useState(''); |
|
|
|
const [roadmapTerm, setRoadmapTerm] = useState(term); |
|
|
|
const [generatedRoadmapContent, setGeneratedRoadmapContent] = useState(''); |
|
|
|
const [generatedRoadmapContent, setGeneratedRoadmapContent] = useState(''); |
|
|
|
const [currentRoadmap, setCurrentRoadmap] = |
|
|
|
const [currentRoadmap, setCurrentRoadmap] = |
|
|
|
useState<GetAIRoadmapResponse | null>(null); |
|
|
|
useState<GetAIRoadmapResponse | null>(null); |
|
|
@ -406,7 +407,7 @@ export function GenerateRoadmap(props: GenerateRoadmapProps) { |
|
|
|
limitUsed={roadmapLimitUsed} |
|
|
|
limitUsed={roadmapLimitUsed} |
|
|
|
loadAIRoadmapLimit={loadAIRoadmapLimit} |
|
|
|
loadAIRoadmapLimit={loadAIRoadmapLimit} |
|
|
|
isKeyOnly={isKeyOnly} |
|
|
|
isKeyOnly={isKeyOnly} |
|
|
|
onLoadTerm={(term: string) => { |
|
|
|
onLoadTerm={(term) => { |
|
|
|
setRoadmapTerm(term); |
|
|
|
setRoadmapTerm(term); |
|
|
|
loadTermRoadmap(term).finally(() => {}); |
|
|
|
loadTermRoadmap(term).finally(() => {}); |
|
|
|
}} |
|
|
|
}} |
|
|
|