Defer profile world history until needed

This commit is contained in:
test
2026-08-30 12:02:07 +02:00
parent 5c80402aed
commit 937f484cc9
8 changed files with 282 additions and 11 deletions
@@ -1,7 +1,7 @@
import React from 'react'
import ProfileWorldHistorySection from '../worlds/ProfileWorldHistorySection'
export default function TabWorlds({ worldHistory, isOwner }) {
export default function TabWorlds({ worldHistory, isOwner, loading = false, error = false, onRetry }) {
return (
<div
id="tabpanel-worlds"
@@ -9,7 +9,14 @@ export default function TabWorlds({ worldHistory, isOwner }) {
aria-labelledby="tab-worlds"
className="pt-6"
>
{loading ? <p className="mb-4 text-sm text-slate-400">Loading worlds history…</p> : null}
{error ? (
<div className="mb-4 flex items-center gap-3 text-sm text-rose-300">
<span>Worlds history could not be loaded.</span>
<button type="button" onClick={onRetry} className="underline underline-offset-2">Retry</button>
</div>
) : null}
<ProfileWorldHistorySection history={worldHistory} isOwner={isOwner} />
</div>
)
}
}