2025-07-23 22:26:54 -04:00
|
|
|
import Layout from '../components/Layout';
|
2026-06-03 18:01:30 -04:00
|
|
|
import CollectionsPageView from '../components/CollectionsPageView';
|
2025-07-26 23:23:31 -04:00
|
|
|
import { useAuth } from '../lib/use-auth';
|
2026-06-03 18:01:30 -04:00
|
|
|
import { useCollectionsPage } from '../lib/use-collections-page.js';
|
2025-07-23 22:26:54 -04:00
|
|
|
|
|
|
|
|
export default function Collections() {
|
2025-07-26 23:23:31 -04:00
|
|
|
const { user, loading: authLoading } = useAuth();
|
2026-06-03 18:01:30 -04:00
|
|
|
const collectionsPage = useCollectionsPage({ user, authLoading });
|
2025-07-23 22:26:54 -04:00
|
|
|
|
2026-06-03 18:01:30 -04:00
|
|
|
if (collectionsPage.showInitialLoading) {
|
2025-07-23 22:26:54 -04:00
|
|
|
return (
|
|
|
|
|
<Layout user={user}>
|
|
|
|
|
<div className="flex items-center justify-center min-h-screen">
|
2026-06-03 18:01:30 -04:00
|
|
|
<div className="animate-spin rounded-full h-32 w-32 border-b-2" style={{ borderColor: 'var(--accent-ember)' }} />
|
2025-07-23 22:26:54 -04:00
|
|
|
</div>
|
|
|
|
|
</Layout>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2025-07-26 23:23:31 -04:00
|
|
|
if (!user) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
2025-07-23 22:26:54 -04:00
|
|
|
return (
|
|
|
|
|
<Layout user={user}>
|
2026-06-03 18:01:30 -04:00
|
|
|
<CollectionsPageView {...collectionsPage} />
|
2025-07-23 22:26:54 -04:00
|
|
|
</Layout>
|
|
|
|
|
);
|
2026-06-03 18:01:30 -04:00
|
|
|
}
|