Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Commit

Permalink
feat: extra info on settings page
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiejaoude committed Jun 24, 2024
1 parent f7d2401 commit 9bf92aa
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/app/account/profile/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ export default async function Page() {

const user = await prisma.user.findUnique({
where: { id: session.user.id },
include: {
platforms: true,
},
});

return (
Expand Down Expand Up @@ -49,7 +52,23 @@ export default async function Page() {
Section title
</h2>
<div className="overflow-hidden rounded-lg bg-white shadow">
<div className="p-6">{/* Your content */}</div>
<div className="p-6">
{user.platforms?.length ? (
<Alert
type="info"
message={`You have ${
user.platforms.length
} links/platforms: ${user.platforms
.map((platform) => platform.name)
.join(", ")}`}
/>
) : (
<Alert
type="warning"
message={`You have NO links/platforms, you need at least 1 for your profile to appear in public`}
/>
)}
</div>
</div>
</section>
</div>
Expand Down

0 comments on commit 9bf92aa

Please sign in to comment.