deckhearth/pages/collections.js
Randall Stillwell 2a8e674b38 Extract useCollectionsPage hook and CollectionsPageView (Brief 3).
Moves list index logic into a hook and view; CollectionsThumbnail is a shared presentational component.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 17:01:30 -05:00

29 lines
855 B
JavaScript

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