refactor(card): useCardDetail + CardDetailView (Brief 3) #86
2 changed files with 3 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
|
|
|
|||
Loading…
Reference in a new issue