capa adicional sobre lo que ya deployaste
Some checks failed
/ Deploy to Cloudflare Pages (push) Has been cancelled
Some checks failed
/ Deploy to Cloudflare Pages (push) Has been cancelled
This commit is contained in:
@@ -381,7 +381,7 @@ function HomeView({
|
||||
currentUserId: string
|
||||
onShared: () => void
|
||||
}) {
|
||||
const { groups, processes, settings, createGroup, isLoading } = useLibraryStore()
|
||||
const { groups, processes, settings, createGroup, isLoading, error, load } = useLibraryStore()
|
||||
const { user } = useAuth()
|
||||
const [search, setSearch] = useState('')
|
||||
const [activeTags, setActiveTags] = useState<string[]>([])
|
||||
@@ -422,6 +422,24 @@ function HomeView({
|
||||
)
|
||||
}
|
||||
|
||||
// Error state: el load() falló o se colgó (timeout) — distinto de "biblioteca vacía"
|
||||
if (error && groups.length === 0 && processes.length === 0) {
|
||||
return (
|
||||
<div className="flex flex-col items-center justify-center py-24 gap-4">
|
||||
<Building2 className="h-16 w-16 text-destructive/40" />
|
||||
<p className="text-base font-medium">No se pudo cargar la biblioteca</p>
|
||||
<p className="text-[13px] text-muted-foreground max-w-sm text-center">{error}</p>
|
||||
<button
|
||||
onClick={() => load()}
|
||||
className="flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium text-white transition-opacity hover:opacity-90"
|
||||
style={{ background: '#F59845' }}
|
||||
>
|
||||
Reintentar
|
||||
</button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
// Empty state: sin grupos ni procesos (ya terminó de cargar)
|
||||
if (groups.length === 0 && processes.length === 0) {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user