diff --git a/src/components/Dashboard/ProgressStack.tsx b/src/components/Dashboard/ProgressStack.tsx index 56ee0357b..4515e08d1 100644 --- a/src/components/Dashboard/ProgressStack.tsx +++ b/src/components/Dashboard/ProgressStack.tsx @@ -1,4 +1,10 @@ -import { ArrowUpRight } from 'lucide-react'; +import { + ArrowUpRight, + Bookmark, + FolderKanban, + type LucideIcon, + Map, +} from 'lucide-react'; import type { UserProgress } from '../TeamProgress/TeamProgressPage'; import type { ProjectStatusDocument } from '../Projects/ListProjectSolutions'; import { DashboardBookmarkCard } from './DashboardBookmarkCard'; @@ -28,9 +34,14 @@ type ProgressLaneProps = { linkText?: string; linkHref?: string; isLoading?: boolean; + isEmpty?: boolean; loadingSkeletonCount?: number; loadingSkeletonClassName?: string; children: React.ReactNode; + emptyMessage?: string; + emptyIcon?: LucideIcon; + emptyLinkText?: string; + emptyLinkHref?: string; }; function ProgressLane(props: ProgressLaneProps) { @@ -42,25 +53,37 @@ function ProgressLane(props: ProgressLaneProps) { loadingSkeletonCount = 4, loadingSkeletonClassName = '', children, + isEmpty = false, + emptyIcon: EmptyIcon = Map, + emptyMessage = `No ${title.toLowerCase()} to show`, + emptyLinkHref = '/roadmaps', + emptyLinkText = 'Explore', } = props; return ( -
-
-

{title}

+
+ {isLoading && ( +
+
+
+ )} + {!isLoading && !isEmpty && ( +
+

{title}

- {linkText && linkHref && ( - - - {linkText} - - )} -
+ {linkText && linkHref && ( + + + {linkText} + + )} +
+ )} -
+
{isLoading && ( <> {Array.from({ length: loadingSkeletonCount }).map((_, index) => ( @@ -69,6 +92,23 @@ function ProgressLane(props: ProgressLaneProps) { )} {!isLoading && children} + + {!isLoading && isEmpty && ( +
+ + {emptyMessage} + + {emptyLinkText} + +
+ )}
); @@ -129,9 +169,13 @@ export function ProgressStack(props: ProgressStackProps) {
{userProgressesToShow.length > 0 && ( <> @@ -162,6 +206,11 @@ export function ProgressStack(props: ProgressStackProps) { isLoading={isLoading} loadingSkeletonClassName={'h-5'} loadingSkeletonCount={8} + isEmpty={projectsToShow.length === 0} + emptyMessage={'No projects started'} + emptyIcon={FolderKanban} + emptyLinkText={'Explore Projects'} + emptyLinkHref={'/backend/projects'} > {projectsToShow.map((project) => { return ( @@ -187,6 +236,11 @@ export function ProgressStack(props: ProgressStackProps) { loadingSkeletonCount={8} linkHref={'/roadmaps'} linkText={'Explore'} + isEmpty={bookmarksToShow.length === 0} + emptyIcon={Bookmark} + emptyMessage={'No bookmarks to show'} + emptyLinkHref={'/roadmaps'} + emptyLinkText={'Explore Roadmaps'} > {bookmarksToShow.map((progress) => { return (