refactor(card): useCardDetail + CardDetailView (Brief 3) #86

Merged
varutasu merged 2 commits from refactor/card-id-split-brief-3 into main 2026-06-03 18:10:14 -04:00
2 changed files with 3 additions and 3 deletions
Showing only changes of commit 2777f18dbb - Show all commits

View file

@ -5,7 +5,7 @@ import { VOCAB, collectionDisplayName } from './collection-vocabulary.js';
/**
* 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 isAdmin = user?.role === 'admin';
const adminLoading = authLoading;

View file

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