mirror of
https://github.com/emailerfacu-spec/minix-front.git
synced 2026-04-01 13:10:44 -03:00
arreglada recarga al borrar un usuario
This commit is contained in:
@@ -6,14 +6,19 @@
|
||||
import TablaUsuarios from '@/components/TablaUsuarios.svelte';
|
||||
import CardTitle from '@/components/ui/card/card-title.svelte';
|
||||
import CardHeader from '@/components/ui/card/card-header.svelte';
|
||||
import type { UserResponseDto } from '../../../types';
|
||||
|
||||
let cargando = $state(true);
|
||||
let usuarios = $state(page.data.usuarios);
|
||||
interface Prop {
|
||||
usuarios?: UserResponseDto[];
|
||||
error: boolean;
|
||||
}
|
||||
|
||||
let { data }: Prop = $props();
|
||||
</script>
|
||||
|
||||
<div class="flex min-h-fit w-full items-center justify-center p-6 md:p-10">
|
||||
<div class="w-full max-w-6xl">
|
||||
<Card class={page.data.error ? 'border-red-400' : ''}>
|
||||
<Card class={data.error ? 'border-red-400' : ''}>
|
||||
<CardHeader class="w-full">
|
||||
<CardTitle class="rounded-full bg-accent-foreground/10">
|
||||
<h1 class="mt-3 mb-4 scroll-m-20 text-center text-2xl font-extrabold tracking-tight">
|
||||
@@ -22,12 +27,10 @@
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
{#if page.data.usuarios.length === 0}
|
||||
{#if data.usuarios?.length === 0}
|
||||
<CardDescription>No hay usuarios que mostar</CardDescription>
|
||||
{:else}
|
||||
{#key page.data.usuarios}
|
||||
<TablaUsuarios bind:usuarios></TablaUsuarios>
|
||||
{/key}
|
||||
<TablaUsuarios usuarios={data.usuarios || []}></TablaUsuarios>
|
||||
{/if}
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
Reference in New Issue
Block a user