Defer profile world history until needed
This commit is contained in:
@@ -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>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user