Skip to content

Commit 311351e

Browse files
committed
fix(pathways/swipe): handle skill objects with name/level/keywords structure
Skills can be either strings or objects with {name, level, keywords}. Updated SwipeCard and SwipeDetailSheet to extract skill.name when needed.
1 parent 0f6e2fb commit 311351e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

apps/registry/app/pathways/swipe/components/SwipeCard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export default function SwipeCard({
135135
key={i}
136136
className="px-2 py-0.5 bg-indigo-50 text-indigo-700 text-xs rounded"
137137
>
138-
{skill}
138+
{typeof skill === 'string' ? skill : skill?.name || 'Unknown'}
139139
</span>
140140
))}
141141
</div>

apps/registry/app/pathways/swipe/components/SwipeDetailSheet.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ export default function SwipeDetailSheet({
126126
key={i}
127127
className="px-2.5 py-1 bg-indigo-50 text-indigo-700 text-sm rounded"
128128
>
129-
{skill}
129+
{typeof skill === 'string'
130+
? skill
131+
: skill?.name || 'Unknown'}
130132
</span>
131133
))}
132134
</div>
@@ -145,7 +147,9 @@ export default function SwipeDetailSheet({
145147
key={i}
146148
className="px-2.5 py-1 bg-gray-100 text-gray-600 text-sm rounded"
147149
>
148-
{skill}
150+
{typeof skill === 'string'
151+
? skill
152+
: skill?.name || 'Unknown'}
149153
</span>
150154
))}
151155
</div>

0 commit comments

Comments
 (0)