mirror of
https://github.com/Sosokker/B2D-Ventures.git
synced 2025-12-20 14:34:05 +01:00
feat: improve tag display logic in ProjectCard component to filter out null or blank tags
This commit is contained in:
parent
40b0c7dcdc
commit
1c8d68183a
@ -71,15 +71,19 @@ export function ProjectCard(props: ProjectCardProps) {
|
|||||||
<span className="text-xs">{props.location}</span>
|
<span className="text-xs">{props.location}</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-wrap mt-1 items-center text-muted-foreground">
|
<div className="flex flex-wrap mt-1 items-center text-muted-foreground">
|
||||||
{props.tags && Array.isArray(props.tags) ? (
|
{props.tags?.length !== 0 && Array.isArray(props.tags)
|
||||||
props.tags.map((tag) => (
|
? props.tags
|
||||||
<span id="tag" key={tag} className="text-[10px] rounded-md bg-slate-200 dark:bg-slate-700 p-1 mr-1">
|
.filter((tag) => tag && tag.trim() !== "") // Filters out null or blank tags
|
||||||
|
.map((tag) => (
|
||||||
|
<span
|
||||||
|
id="tag"
|
||||||
|
key={tag}
|
||||||
|
className="text-[10px] rounded-md bg-slate-200 dark:bg-slate-700 p-1 mr-1"
|
||||||
|
>
|
||||||
{tag}
|
{tag}
|
||||||
</span>
|
</span>
|
||||||
))
|
))
|
||||||
) : (
|
: null}
|
||||||
<span className="text-xs text-muted-foreground">No tags available</span>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user