import type { UserProgress } from '../TeamProgress/TeamProgressPage'; import { DashboardCustomProgressCard } from './DashboardCustomProgressCard'; import { DashboardCardLink } from './DashboardCardLink'; import { useState } from 'react'; import { CreateRoadmapModal } from '../CustomRoadmap/CreateRoadmap/CreateRoadmapModal'; import { ArrowUpRight, Bot, BrainCircuit, Map, PencilRuler, } from 'lucide-react'; type ListDashboardCustomProgressProps = { progresses: UserProgress[]; isLoading?: boolean; isCustomResources?: boolean; isAIGeneratedRoadmaps?: boolean; }; export function ListDashboardCustomProgress( props: ListDashboardCustomProgressProps, ) { const { progresses, isLoading = false, isAIGeneratedRoadmaps = false, } = props; const [isCreateCustomRoadmapModalOpen, setIsCreateCustomRoadmapModalOpen] = useState(false); const customRoadmapModal = isCreateCustomRoadmapModalOpen ? ( setIsCreateCustomRoadmapModalOpen(false)} onCreated={(roadmap) => { window.location.href = `${ import.meta.env.PUBLIC_EDITOR_APP_URL }/${roadmap?._id}`; return; }} /> ) : null; return ( <> {customRoadmapModal}

{isAIGeneratedRoadmaps ? 'My AI Roadmaps' : 'My Custom Roadmaps'}

Community Roadmaps
{!isLoading && progresses.length === 0 && isAIGeneratedRoadmaps && ( )} {!isLoading && progresses.length === 0 && !isAIGeneratedRoadmaps && ( )}
{isLoading && ( <> {Array.from({ length: 8 }).map((_, index) => ( ))} )} {!isLoading && progresses.length > 0 && ( <> {progresses.map((progress) => ( ))} { if (!isAIGeneratedRoadmaps) { e.preventDefault(); setIsCreateCustomRoadmapModalOpen(true); } }} > {isAIGeneratedRoadmaps ? '+ Generate New' : '+ Create New'} )}
); } type CustomProgressCardSkeletonProps = {}; export function CustomProgressCardSkeleton( props: CustomProgressCardSkeletonProps, ) { return (
); }