Skip to content

Commit 561b4d0

Browse files
committed
feat(pages): added message when knowledger has no published articles
1 parent 3398ee9 commit 561b4d0

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

src/pages/Profile.tsx

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,19 @@ export function Profile() {
5656
<h3 className="text-xl font-bold mb-4">Artigos Publicados</h3>
5757

5858
<div className="flex flex-col gap-2">
59-
{user?.posts.map((post) => (
60-
<Link to={`/posts/${post.slug}`}>
61-
<a
62-
href=""
63-
className="text-blue-400 font-semibold hover:underline"
64-
>
65-
{post.title}
66-
</a>
67-
</Link>
68-
))}
59+
{user?.posts && user.posts.length > 0 ? (
60+
user?.posts.map((post) => (
61+
<Link key={post.slug} to={`/posts/${post.slug}`}>
62+
<span className="text-blue-400 font-semibold hover:underline">
63+
{post.title}
64+
</span>
65+
</Link>
66+
))
67+
) : (
68+
<p className="text-blue-400 font-semibold">
69+
Não há artigos publicados no momento.
70+
</p>
71+
)}
6972
</div>
7073
</div>
7174
</div>
@@ -86,7 +89,7 @@ export function Profile() {
8689
target="_blank"
8790
className="hover:text-blue-400"
8891
>
89-
<Icon key={index} size={32} />
92+
<Icon size={32} />
9093
</a>
9194
)
9295
)}

0 commit comments

Comments
 (0)