fix(market-card.tsx): add conditional rendering for username to prevent error when data.user_created.username is undefined

This commit is contained in:
cristhianzl 2023-11-16 11:47:39 -03:00
commit 8803e944ee

View file

@ -171,9 +171,12 @@ export const MarketCardComponent = ({
</div>
</CardTitle>
</div>
<span className="text-xs text-primary">
by <b>{data.user_created.username}</b>
</span>
{data.user_created.username && (
<span className="text-xs text-primary">
by <b>{data.user_created.username}</b>
</span>
)}
<CardDescription className="pb-2 pt-2">
<div className="truncate-doubleline">{data.description}</div>
</CardDescription>