mirror of
https://github.com/emailerfacu-spec/minix-front.git
synced 2026-04-12 15:00:43 -03:00
bun run format
This commit is contained in:
@@ -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
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -19,4 +19,4 @@ export const load: PageLoad = async ({ params, fetch }) => {
|
||||
usuario,
|
||||
seguidores: seguidoresResponse?.response || []
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user