algunos arreglos a la ui y correjido un cambio en una api

This commit is contained in:
2025-12-22 20:19:42 -03:00
parent ae381c00ff
commit 252e1d0b98
7 changed files with 156 additions and 130 deletions

View File

@@ -80,50 +80,7 @@
<div class="flex min-h-fit w-full items-center justify-center p-6 md:p-10">
<div class="w-full max-w-6xl">
<div class="flex gap-2">
<CardPerfil bind:data />
<aside class="flex w-1/4 flex-col gap-2">
<Card class="w-full">
<CardContent>
<CardHeader class="flex justify-between">
<CardTitle>Seguidos:</CardTitle>
<Badge variant="secondary">{data.seguidos.length}</Badge>
</CardHeader>
<CardContent>
{#if data.seguidos.length === 0}
<h3>No hay Seguidos</h3>
{:else}
{#each data.seguidos as seguidos (seguidos.id)}
<p class="text-muted-foreground">
{seguidos.username}
</p>
{/each}
{/if}
</CardContent>
</CardContent>
</Card>
<Card class="w-full">
<CardContent>
<CardHeader class="flex justify-between">
<CardTitle>Seguidores:</CardTitle>
<Badge variant="secondary">{data.seguidores.length}</Badge>
</CardHeader>
<CardContent>
{#if data.seguidores.length === 0}
<h3>No hay Seguidores</h3>
{:else}
{#each data.seguidores as seguidores (seguidores.id)}
<p class="text-muted-foreground">
{seguidores.username}
</p>
{/each}
{/if}
</CardContent>
</CardContent>
</Card>
</aside>
</div>
<h1
class="mt-10 flex scroll-m-20 justify-between text-3xl font-extrabold tracking-tight lg:text-3xl"
>

View File

@@ -5,11 +5,13 @@ import { obtenerSeguidosPorUsuario } from '@/hooks/obtenerSeguidosPorUsuario.js'
import { obtenerSeguidoresPorUsuario } from '@/hooks/obtenerSeguidoresPorUsuario.js';
export async function load({ params }) {
const usuario: UserResponseDto | null = await obtenerUsuarioPorUsername(params.perfil);
if(!usuario) error(404, 'No se encontro el usuario, ' + params.perfil);
const usuario: UserResponseDto | null = await obtenerUsuarioPorUsername(params.perfil);
if (!usuario) error(404, 'No se encontro el usuario, ' + params.perfil);
const seguidos = await obtenerSeguidosPorUsuario(usuario.id, 3);
const seguidores = await obtenerSeguidoresPorUsuario(usuario.id, 3);
const [seguidos, seguidores] = await Promise.all([
obtenerSeguidosPorUsuario(usuario.id, 3),
obtenerSeguidoresPorUsuario(usuario.id, 3)
]);
return { ...usuario, seguidos, seguidores };
return { ...usuario, seguidos, seguidores };
}