From 231013744a758048e7a40f2de949fd4f2f8b0710 Mon Sep 17 00:00:00 2001 From: Arik Chakma Date: Thu, 18 Apr 2024 11:36:02 +0600 Subject: [PATCH] wip --- src/components/GenerateRoadmap/GenerateRoadmap.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/GenerateRoadmap/GenerateRoadmap.tsx b/src/components/GenerateRoadmap/GenerateRoadmap.tsx index d5ad8d0a5..48e021ddb 100644 --- a/src/components/GenerateRoadmap/GenerateRoadmap.tsx +++ b/src/components/GenerateRoadmap/GenerateRoadmap.tsx @@ -89,10 +89,11 @@ type GetAIRoadmapResponse = { type GenerateRoadmapProps = { roadmapId?: string; + t?: string; }; export function GenerateRoadmap(props: GenerateRoadmapProps) { - const { roadmapId } = props; + const { roadmapId, t: term = '' } = props; const roadmapContainerRef = useRef(null); @@ -104,7 +105,7 @@ export function GenerateRoadmap(props: GenerateRoadmapProps) { const [hasSubmitted, setHasSubmitted] = useState(Boolean(roadmapId)); const [isLoading, setIsLoading] = useState(false); const [isLoadingResults, setIsLoadingResults] = useState(false); - const [roadmapTerm, setRoadmapTerm] = useState(''); + const [roadmapTerm, setRoadmapTerm] = useState(term); const [generatedRoadmapContent, setGeneratedRoadmapContent] = useState(''); const [currentRoadmap, setCurrentRoadmap] = useState(null); @@ -406,7 +407,7 @@ export function GenerateRoadmap(props: GenerateRoadmapProps) { limitUsed={roadmapLimitUsed} loadAIRoadmapLimit={loadAIRoadmapLimit} isKeyOnly={isKeyOnly} - onLoadTerm={(term: string) => { + onLoadTerm={(term) => { setRoadmapTerm(term); loadTermRoadmap(term).finally(() => {}); }}