Fix useCardDetail call and default params for prerender

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Randall Stillwell 2026-06-03 17:03:43 -05:00
parent 4a1adb6bcc
commit 2777f18dbb
2 changed files with 3 additions and 3 deletions

View file

@ -5,7 +5,7 @@ import { VOCAB, collectionDisplayName } from './collection-vocabulary.js';
/** /**
* Card/collection page state and handlers (god-component split). * Card/collection page state and handlers (god-component split).
*/ */
export function useCardDetail({ user, authLoading }) { export function useCardDetail({ user = null, authLoading = true } = {}) {
const router = useRouter(); const router = useRouter();
const isAdmin = user?.role === 'admin'; const isAdmin = user?.role === 'admin';
const adminLoading = authLoading; const adminLoading = authLoading;

View file

@ -6,8 +6,8 @@ import { useCardDetail } from '../../lib/use-card-detail.js';
export default function CardDetail() { export default function CardDetail() {
const router = useRouter(); const router = useRouter();
const { user } = useAuth(); const { user, loading: authLoading } = useAuth();
const detail = useCardDetail(); const detail = useCardDetail({ user, authLoading });
if (detail.loading) { if (detail.loading) {
return ( return (