|
|
@ -91,10 +91,15 @@ type GetAIRoadmapResponse = { |
|
|
|
type GenerateRoadmapProps = { |
|
|
|
type GenerateRoadmapProps = { |
|
|
|
roadmapId?: string; |
|
|
|
roadmapId?: string; |
|
|
|
slug?: string; |
|
|
|
slug?: string; |
|
|
|
|
|
|
|
isAuthenticatedUser?: boolean; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
export function GenerateRoadmap(props: GenerateRoadmapProps) { |
|
|
|
export function GenerateRoadmap(props: GenerateRoadmapProps) { |
|
|
|
const { roadmapId: defaultRoadmapId, slug: defaultRoadmapSlug } = props; |
|
|
|
const { |
|
|
|
|
|
|
|
roadmapId: defaultRoadmapId, |
|
|
|
|
|
|
|
slug: defaultRoadmapSlug, |
|
|
|
|
|
|
|
isAuthenticatedUser = isLoggedIn(), |
|
|
|
|
|
|
|
} = props; |
|
|
|
|
|
|
|
|
|
|
|
const roadmapContainerRef = useRef<HTMLDivElement>(null); |
|
|
|
const roadmapContainerRef = useRef<HTMLDivElement>(null); |
|
|
|
|
|
|
|
|
|
|
@ -130,7 +135,6 @@ export function GenerateRoadmap(props: GenerateRoadmapProps) { |
|
|
|
getOpenAIKey(), |
|
|
|
getOpenAIKey(), |
|
|
|
); |
|
|
|
); |
|
|
|
const isKeyOnly = IS_KEY_ONLY_ROADMAP_GENERATION; |
|
|
|
const isKeyOnly = IS_KEY_ONLY_ROADMAP_GENERATION; |
|
|
|
const isAuthenticatedUser = isLoggedIn(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const renderRoadmap = async (roadmap: string) => { |
|
|
|
const renderRoadmap = async (roadmap: string) => { |
|
|
|
const { nodes, edges } = generateAIRoadmapFromText(roadmap); |
|
|
|
const { nodes, edges } = generateAIRoadmapFromText(roadmap); |
|
|
|