[FE-COMP-003] fix: Fix TypeScript errors in empty states

- Fixed isOwnProfile reference in UserProfilePage
- Fixed possibly undefined data in PlaylistList pagination
This commit is contained in:
senke 2025-12-24 14:34:00 +01:00
parent f16a8dc030
commit bddebb33ae
2 changed files with 3 additions and 3 deletions

View file

@ -353,7 +353,7 @@ export function PlaylistList({
className="text-xs sm:text-sm text-muted-foreground text-center sm:text-left"
aria-live="polite"
>
Page {currentPage} sur {totalPages} ({data.total} playlists)
Page {currentPage} sur {totalPages} ({data?.total || 0} playlists)
</div>
<div className="flex items-center gap-2 w-full sm:w-auto">
<Button

View file

@ -256,7 +256,7 @@ export function UserProfilePage() {
<Music className="h-12 w-12 mx-auto mb-4 text-muted-foreground opacity-50" />
<h3 className="text-lg font-semibold mb-2">No tracks yet</h3>
<p className="text-muted-foreground">
{isOwnProfile
{currentUser?.id === profile.id
? 'Start by uploading your first track to share with others.'
: 'This user has not uploaded any tracks yet.'}
</p>
@ -298,7 +298,7 @@ export function UserProfilePage() {
<Library className="h-12 w-12 mx-auto mb-4 text-muted-foreground opacity-50" />
<h3 className="text-lg font-semibold mb-2">No playlists yet</h3>
<p className="text-muted-foreground">
{isOwnProfile
{currentUser?.id === profile.id
? 'Create your first playlist to organize your favorite tracks.'
: 'This user has not created any playlists yet.'}
</p>