bun run format

This commit is contained in:
2026-01-27 19:43:32 -03:00
parent 37f1b46306
commit e1864660a7
19 changed files with 115 additions and 121 deletions

View File

@@ -1,5 +1,5 @@
import { obtenerUsuarioPorUsername } from '@/hooks/obtenerUsuario.js';
import type {UserResponseDto } from '../../types.js';
import type { UserResponseDto } from '../../types.js';
import { error } from '@sveltejs/kit';
import type { PageLoad } from './$types';
import { obtenerSeguidosPorUsuario } from '@/hooks/obtenerSeguidosPorUsuario.js';
@@ -26,4 +26,4 @@ export const load: PageLoad = async ({ params, depends, fetch }) => {
countSeguidores: countSeguidores.count,
countSeguidos: countSeguidos.count
};
};
};

View File

@@ -14,7 +14,7 @@
};
let { data }: { data: Data } = $props();
let currentPage = $state(1);
let isLoading = $state(false);
const limit = 100;
@@ -23,19 +23,18 @@
async function loadPage(page: number) {
if (isLoading) return;
isLoading = true;
const response = await obtenerSeguidoresPorUsuario(data.usuario.id, page, limit);
if (response) {
data.seguidores = response.response as UserResponseDto[];
data.totalCount = response.totalCount;
currentPage = page;
}
isLoading = false;
}
</script>
<div class="flex min-h-fit w-full items-center justify-center p-6 md:p-10">
@@ -51,7 +50,7 @@
<ArrowLeft />
</button>
</div>
{#if isLoading}
<div class="py-8 text-center text-muted-foreground">
<p>Cargando...</p>
@@ -79,11 +78,11 @@
>
<ChevronLeft class="h-5 w-5" />
</button>
<span class="px-4 text-sm text-muted-foreground">
Página {currentPage} de {totalPages}
</span>
<button
class="rounded-md border bg-card p-2 hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50"
onclick={() => loadPage(currentPage + 1)}
@@ -94,4 +93,4 @@
</div>
{/if}
</div>
</div>
</div>

View File

@@ -19,4 +19,4 @@ export const load: PageLoad = async ({ params, fetch }) => {
usuario,
seguidores: seguidoresResponse?.response || []
};
}
};

View File

@@ -14,7 +14,7 @@
};
let { data }: { data: Data } = $props();
let currentPage = $state(1);
let isLoading = $state(false);
const limit = 100;
@@ -23,19 +23,18 @@
async function loadPage(page: number) {
if (isLoading) return;
isLoading = true;
const response = await obtenerSeguidosPorUsuario(data.usuario.id, page, limit);
if (response) {
data.seguidos = response.response as UserResponseDto[];
data.totalCount = response.totalCount;
currentPage = page;
}
isLoading = false;
}
</script>
<div class="flex min-h-fit w-full items-center justify-center p-6 md:p-10">
@@ -51,7 +50,7 @@
<ArrowLeft />
</button>
</div>
{#if isLoading}
<div class="py-8 text-center text-muted-foreground">
<p>Cargando...</p>
@@ -79,11 +78,11 @@
>
<ChevronLeft class="h-5 w-5" />
</button>
<span class="px-4 text-sm text-muted-foreground">
Página {currentPage} de {totalPages}
</span>
<button
class="rounded-md border bg-card p-2 hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50"
onclick={() => loadPage(currentPage + 1)}
@@ -94,4 +93,4 @@
</div>
{/if}
</div>
</div>
</div>