diff --git a/src/components/RoadCard/RoadmapSelect.tsx b/src/components/RoadCard/RoadmapSelect.tsx
index 6207b6218..45d29e856 100644
--- a/src/components/RoadCard/RoadmapSelect.tsx
+++ b/src/components/RoadCard/RoadmapSelect.tsx
@@ -33,37 +33,36 @@ export function RoadmapSelect(props: RoadmapSelectProps) {
}, []);
const canSelectMore = selectedRoadmaps.length < 4;
+ const allProgress = progressList?.filter(
+ (progress) => progress.resourceType === 'roadmap'
+ ) || [];
return (
- {progressList
- ?.filter((progress) => progress.resourceType === 'roadmap')
- .map((progress) => {
- const isSelected = selectedRoadmaps.includes(progress.resourceId);
- const canSelect = isSelected || canSelectMore;
+ {allProgress?.length === 0 &&
No progress tracked so far.
}
+ {allProgress?.map((progress) => {
+ const isSelected = selectedRoadmaps.includes(progress.resourceId);
+ const canSelect = isSelected || canSelectMore;
- return (
-
{
- if (isSelected) {
- setSelectedRoadmaps(
- selectedRoadmaps.filter(
- (roadmap) => roadmap !== progress.resourceId
- )
- );
- } else if (selectedRoadmaps.length < 4) {
- setSelectedRoadmaps([
- ...selectedRoadmaps,
- progress.resourceId,
- ]);
- }
- }}
- />
- );
- })}
+ return (
+ {
+ if (isSelected) {
+ setSelectedRoadmaps(
+ selectedRoadmaps.filter(
+ (roadmap) => roadmap !== progress.resourceId
+ )
+ );
+ } else if (selectedRoadmaps.length < 4) {
+ setSelectedRoadmaps([...selectedRoadmaps, progress.resourceId]);
+ }
+ }}
+ />
+ );
+ })}
);
}
diff --git a/src/pages/account/road-card.astro b/src/pages/account/road-card.astro
index 0d411c1f3..657278254 100644
--- a/src/pages/account/road-card.astro
+++ b/src/pages/account/road-card.astro
@@ -7,7 +7,7 @@ import { RoadCardPage } from '../../components/RoadCard/RoadCardPage';